Skip to content

Commit d100f9d

Browse files
committed
RawPreparedStatement: Add lifecycle docs
1 parent 58dddc9 commit d100f9d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

scylla/src/statement/prepared.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ use crate::statement::Statement;
3232
///
3333
/// Kept separate for performance reasons, because constructing
3434
/// [PreparedStatement] involves allocations.
35+
///
36+
/// # Lifecycle of prepared statement
37+
///
38+
/// When PREPARE request is issued, RawPreparedStatement is returned,
39+
/// and later converted to PreparedStatement.
40+
/// PreparedStatement can be cloned. Clone is a new handle to the same
41+
/// underlying shared data - if the result metadata is updated, it is
42+
/// updated for all clones.
43+
/// PreparedStatement can be turned into UnconfiguredPreparedStatement.
44+
/// Similarly to clone, unconfigured statement is also a handle to the
45+
/// same shared data.
46+
/// UnconfiguredPreparedStatement can be used to create new PreparedStatement
47+
/// objects. Those are also handles to the same shared data.
3548
pub(crate) struct RawPreparedStatement<'statement> {
3649
statement: &'statement Statement,
3750
prepared_response: result::Prepared,

0 commit comments

Comments
 (0)