Skip to content

Commit 87c064e

Browse files
committed
future: document CassFuture(State)
1 parent eb9e431 commit 87c064e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scylla-rust-wrapper/src/future.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,19 @@ impl BoundCallback {
4848
}
4949
}
5050

51+
/// State of the execution of the [CassFuture],
52+
/// together with a join handle of the tokio task that is executing it.
5153
struct CassFutureState {
5254
value: Option<CassFutureResult>,
5355
err_string: Option<String>,
5456
callback: Option<BoundCallback>,
5557
join_handle: Option<JoinHandle<()>>,
5658
}
5759

60+
/// The C-API representation of a future. Implemented as a wrapper around a Rust future
61+
/// that can be awaited and has a callback mechanism. It's **eager** in a way that
62+
/// its execution starts possibly immediately (unless the executor thread pool is nempty,
63+
/// which is the case for the current-thread executor).
5864
pub struct CassFuture {
5965
state: Mutex<CassFutureState>,
6066
wait_for_value: Condvar,

0 commit comments

Comments
 (0)