pub struct CachedQueryPlan<B = ()> {
pub statement: Arc<Statement>,
pub query_text: SmartString,
pub last_used: Instant,
pub usage_count: u64,
pub has_params: bool,
pub param_count: usize,
pub parameter_contract: ParameterContract,
pub normalized_query: SmartString,
pub compiled: Arc<RwLock<CompiledExecution>>,
/* private fields */
}Expand description
Represents a parsed and prepared statement stored in the cache
Fields§
§statement: Arc<Statement>The parsed AST (wrapped in Arc for cheap cloning - statements are immutable)
query_text: SmartStringOriginal query text
last_used: InstantLast time this plan was used (monotonic)
usage_count: u64Number of times this plan has been used
has_params: boolWhether this query has parameter placeholders
param_count: usizeNumber of parameters required
parameter_contract: ParameterContractExact positional/named binding contract.
normalized_query: SmartStringNormalized query text (cache key)
compiled: Arc<RwLock<CompiledExecution>>Compiled execution state (lazily populated on first execution)
Implementations§
Source§impl<B: Default> CachedQueryPlan<B>
impl<B: Default> CachedQueryPlan<B>
Sourcepub fn new(
statement: Arc<Statement>,
query_text: SmartString,
_has_params: bool,
_param_count: usize,
normalized_query: SmartString,
) -> Self
pub fn new( statement: Arc<Statement>, query_text: SmartString, _has_params: bool, _param_count: usize, normalized_query: SmartString, ) -> Self
Create a new cached query plan
Trait Implementations§
Source§impl<B: Clone> Clone for CachedQueryPlan<B>
impl<B: Clone> Clone for CachedQueryPlan<B>
Source§fn clone(&self) -> CachedQueryPlan<B>
fn clone(&self) -> CachedQueryPlan<B>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<B> Freeze for CachedQueryPlan<B>
impl<B> RefUnwindSafe for CachedQueryPlan<B>
impl<B> Send for CachedQueryPlan<B>
impl<B> Sync for CachedQueryPlan<B>
impl<B> Unpin for CachedQueryPlan<B>
impl<B> UnsafeUnpin for CachedQueryPlan<B>
impl<B> UnwindSafe for CachedQueryPlan<B>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more