pub struct LocalStorageLayer { /* private fields */ }Expand description
Local storage layer that tracks modifications on top of a remote layer.
Provides transactional semantics: modifications are tracked locally without
affecting the underlying remote layer or cache. Changes can be inspected via
diff.
§Block-based Storage Strategy
latest_block_number: Current working block number (modifications in HashMap)- Keys queried at a block higher than the last modification of that key, queried at modifications HashMap
- Blocks between first_forked_block_number and latest_block_number are in local_storage table
- Blocks before first_forked_block_number come from remote provider
§Cloning
LocalStorageLayer is cheap to clone. The underlying modifications and
deleted prefixes use Arc<RwLock<_>>, so clones share the same state.
§Thread Safety
The layer is Send + Sync and can be shared across async tasks. All
operations use read/write locks which will block until the lock is acquired.
Implementations§
Source§impl LocalStorageLayer
impl LocalStorageLayer
Sourcepub fn new(
parent: RemoteStorageLayer,
first_forked_block_number: u32,
first_forked_block_hash: H256,
metadata: Metadata,
) -> Self
pub fn new( parent: RemoteStorageLayer, first_forked_block_number: u32, first_forked_block_hash: H256, metadata: Metadata, ) -> Self
Create a new local storage layer.
§Arguments
parent- The remote storage layer to use as the base statefirst_forked_block_number- The initial block number where the fork startedfirst_forked_block_hash- The hash of the first forked blockmetadata- The runtime metadata at the fork point
§Returns
A new LocalStorageLayer with no modifications, with current_block_number set to
first_forked_block_number + 1 (the block being built).
Sourcepub fn get_current_block_number(&self) -> u32
pub fn get_current_block_number(&self) -> u32
Get the current block number.
Sourcepub fn cache(&self) -> &StorageCache
pub fn cache(&self) -> &StorageCache
Get a reference to the underlying storage cache.
This provides access to the cache for operations like clearing local storage.
Sourcepub fn remote(&self) -> &RemoteStorageLayer
pub fn remote(&self) -> &RemoteStorageLayer
Get the underlying remote storage layer.
This provides access to the remote layer for operations that need to fetch data directly from the remote chain (e.g., block headers, bodies). The remote layer maintains a persistent connection to the RPC endpoint.
Sourcepub fn fork_block_hash(&self) -> H256
pub fn fork_block_hash(&self) -> H256
Get the hash of the first forked block.
This is the block hash at which the fork was created, used for querying storage keys on the remote chain.
Sourcepub async fn metadata_at(
&self,
block_number: u32,
) -> Result<Arc<Metadata>, LocalStorageError>
pub async fn metadata_at( &self, block_number: u32, ) -> Result<Arc<Metadata>, LocalStorageError>
Get the metadata valid at a specific block number.
For blocks at or after the fork point, returns metadata from the local version tree. For blocks before the fork point, fetches metadata from the remote node.
§Arguments
block_number- The block number to get metadata for
§Returns
Ok(Arc<Metadata>)- The metadata valid at the given blockErr(_)- Lock error, RPC error, or metadata decode error
Sourcepub fn register_metadata_version(
&self,
block_number: u32,
metadata: Metadata,
) -> Result<(), LocalStorageError>
pub fn register_metadata_version( &self, block_number: u32, metadata: Metadata, ) -> Result<(), LocalStorageError>
Register a new metadata version starting at the given block number.
This should be called when a runtime upgrade occurs (:code storage key changes)
to record that a new metadata version is now active.
§Arguments
block_number- The block number where this metadata becomes validmetadata- The new runtime metadata
§Returns
Ok(())- Metadata version registered successfullyErr(_)- Lock error
Sourcepub fn has_code_changed_at(
&self,
block_number: u32,
) -> Result<bool, LocalStorageError>
pub fn has_code_changed_at( &self, block_number: u32, ) -> Result<bool, LocalStorageError>
Check if the :code storage key was modified at the specified block.
This is used to detect runtime upgrades. When a runtime upgrade occurs in block X, the new runtime is used starting from block X+1. So when building X+1, we check if code changed in X (the parent) to determine if we’re now using a new runtime.
§Arguments
block_number- The block number to check for code modifications
§Returns
Ok(true)- The:codekey was modified at the specified blockOk(false)- The:codekey was not modified at the specified blockErr(_)- Lock error
Sourcepub async fn get(
&self,
block_number: u32,
key: &[u8],
) -> Result<Option<Arc<LocalSharedValue>>, LocalStorageError>
pub async fn get( &self, block_number: u32, key: &[u8], ) -> Result<Option<Arc<LocalSharedValue>>, LocalStorageError>
Get a storage value, checking local modifications first.
§Arguments
key- The storage key to fetch
§Returns
Ok(Some(value))- Value exists (either modified locally, in local_storage, or in parent)Ok(None)- Key doesn’t exist or was deleted via prefix deletionErr(_)- Lock error or parent layer error
§Behavior
Storage lookup strategy based on block_number:
- If
block_number == latest_block_numberor the key in local modifications is valid for this block: Check modifications HashMap, then remote at first_forked_block - If
first_forked_block_number < block_number < latest_block_number: Check local_storage table - Otherwise: Check remote provider directly (fetches block_hash from blocks table)
Sourcepub async fn next_key(
&self,
prefix: &[u8],
key: &[u8],
) -> Result<Option<Vec<u8>>, LocalStorageError>
pub async fn next_key( &self, prefix: &[u8], key: &[u8], ) -> Result<Option<Vec<u8>>, LocalStorageError>
Get the next key after the given key that starts with the prefix.
§Arguments
prefix- Storage key prefix to matchkey- The current key; returns the next key after this one
§Returns
Ok(Some(key))- The next key afterkeythat starts withprefixOk(None)- No more keys with this prefixErr(_)- Lock error or parent layer error
§Behavior
- Queries the parent layer for the next key
- Skips keys that match deleted prefixes
- Does not consider locally modified keys (they are transient)
§Note
This method currently delegates directly to the parent layer. Locally modified keys are not included in key enumeration since they represent uncommitted changes.
Sourcepub async fn keys_by_prefix(
&self,
prefix: &[u8],
block_number: u32,
) -> Result<Vec<Vec<u8>>, LocalStorageError>
pub async fn keys_by_prefix( &self, prefix: &[u8], block_number: u32, ) -> Result<Vec<Vec<u8>>, LocalStorageError>
Enumerate all keys matching a prefix, merging remote and local state.
This method combines keys from the remote layer (at the fork point) with locally modified keys, producing a sorted, deduplicated list of keys that exist at the specified fork-local block.
For the latest block, uses the in-memory modifications and
deleted_prefixes snapshots. For historical fork-local blocks, queries
the persisted local values in the cache to reconstruct the key set that
existed at that block.
Keys that were deleted locally (either individually via set(key, None)
or via delete_prefix) are excluded.
Sourcepub fn set(
&self,
key: &[u8],
value: Option<&[u8]>,
) -> Result<(), LocalStorageError>
pub fn set( &self, key: &[u8], value: Option<&[u8]>, ) -> Result<(), LocalStorageError>
Set a storage value locally.
§Arguments
key- The storage key to setvalue- The value to set, orNoneto mark as deleted
§Returns
Ok(())- Value was set successfullyErr(_)- Lock error
§Behavior
- Does not affect the parent layer or underlying cache
- Overwrites any previous local modification for this key
- Passing
Nonemarks the key as explicitly deleted (different from never set)
Sourcepub fn set_initial(
&self,
key: &[u8],
value: Option<&[u8]>,
) -> Result<(), LocalStorageError>
pub fn set_initial( &self, key: &[u8], value: Option<&[u8]>, ) -> Result<(), LocalStorageError>
Set a storage value visible from the fork point onwards.
Unlike Self::set, which records the modification at the current working block,
this marks the entry with last_modification_block = first_forked_block_number - 1
(saturating at 0) so it is visible immediately at the fork head and for any later
fork-local query, but not for historical pre-fork queries.
This is used for injecting initial state (e.g., dev accounts, sudo key)
that should be readable before any block is built.
These entries are never committed to the persistent cache by Self::commit
(which only commits entries at current_block_number), but they remain in
the in-memory modifications map for the lifetime of the fork.
Sourcepub async fn get_batch(
&self,
block_number: u32,
keys: &[&[u8]],
) -> Result<Vec<Option<Arc<LocalSharedValue>>>, LocalStorageError>
pub async fn get_batch( &self, block_number: u32, keys: &[&[u8]], ) -> Result<Vec<Option<Arc<LocalSharedValue>>>, LocalStorageError>
Get multiple storage values in a batch.
§Arguments
block_number- The block number to querykeys- Slice of storage keys to fetch (as byte slices)
§Returns
Ok(vec)- Vector of optional values, in the same order as input keysErr(_)- Lock error or parent layer error
§Behavior
Storage lookup strategy based on block_number (same as get):
- If
block_number == latest_block_number: Check modifications HashMap, then remote at first_forked_block - If
first_forked_block_number < block_number < latest_block_numberand the key is valid forblock_number: Check modifications HashMap table - If
first_forked_block_number < block_number < latest_block_number: Check local_storage table - Otherwise: Check remote provider directly (fetches block_hash from blocks table)
Sourcepub fn set_batch(
&self,
entries: &[(&[u8], Option<&[u8]>)],
) -> Result<(), LocalStorageError>
pub fn set_batch( &self, entries: &[(&[u8], Option<&[u8]>)], ) -> Result<(), LocalStorageError>
Set multiple storage values locally in a batch.
§Arguments
entries- Slice of (key, value) pairs to set
§Returns
Ok(())- All values were set successfullyErr(_)- Lock error
§Behavior
- Does not affect the parent layer or underlying cache
- Overwrites any previous local modifications for the given keys
Nonevalues mark keys as explicitly deleted- More efficient than calling
set()multiple times due to single lock acquisition
Sourcepub fn set_batch_initial(
&self,
entries: &[(&[u8], Option<&[u8]>)],
) -> Result<(), LocalStorageError>
pub fn set_batch_initial( &self, entries: &[(&[u8], Option<&[u8]>)], ) -> Result<(), LocalStorageError>
Batch version of Self::set_initial.
Sets multiple storage values visible from the fork point onwards, using
last_modification_block = first_forked_block_number - 1 (saturating at 0).
See Self::set_initial
for details.
Sourcepub fn delete_prefix(&self, prefix: &[u8]) -> Result<(), LocalStorageError>
pub fn delete_prefix(&self, prefix: &[u8]) -> Result<(), LocalStorageError>
Delete all keys matching a prefix.
§Arguments
prefix- The prefix to match for deletion
§Returns
Ok(())- Prefix was marked as deleted successfullyErr(_)- Lock error
§Behavior
- Removes all locally modified keys that start with the prefix
- Marks the prefix as deleted, affecting future
get()calls - Keys in the parent layer matching this prefix will return
Noneafter this call
Sourcepub fn is_deleted(&self, prefix: &[u8]) -> Result<bool, LocalStorageError>
pub fn is_deleted(&self, prefix: &[u8]) -> Result<bool, LocalStorageError>
Check if a prefix has been deleted.
§Arguments
prefix- The prefix to check
§Returns
Ok(true)- Prefix has been deleted viadelete_prefixOk(false)- Prefix has not been deletedErr(_)- Lock error
Sourcepub fn diff(
&self,
) -> Result<Vec<(Vec<u8>, Option<Arc<LocalSharedValue>>)>, LocalStorageError>
pub fn diff( &self, ) -> Result<Vec<(Vec<u8>, Option<Arc<LocalSharedValue>>)>, LocalStorageError>
Get all local modifications as a vector.
§Returns
Ok(vec)- Vector of (key, value) pairs representing all local changesErr(_)- Lock error
§Behavior
- Returns only locally modified keys, not the full state
Nonevalues indicate keys that were explicitly deleted- Does not include keys deleted via prefix deletion
Sourcepub async fn commit(&mut self) -> Result<(), LocalStorageError>
pub async fn commit(&mut self) -> Result<(), LocalStorageError>
Commit modifications to the local storage tables, creating new validity entries.
§Returns
Ok(())- All modifications were successfully committed to the cacheErr(_)- Lock error or cache error
§Behavior
- Only commits modifications whose
last_modification_block == latest_block_number - For each key to commit:
- If key not in local_keys: insert key, then insert value with valid_from = latest_block_number
- If key exists: close current open value (set valid_until), insert new value
- The modifications HashMap remains intact and available after commit
- Increases the latest block number
Sourcepub fn child(&self) -> LocalStorageLayer
pub fn child(&self) -> LocalStorageLayer
Create a child layer for nested modifications.
§Returns
A cloned LocalStorageLayer that shares the same parent and state.
§Behavior
- The child shares the same
modificationsanddeleted_prefixesviaArc - Changes in the child affect the parent and vice versa
- Useful for creating temporary scopes that can be discarded
§Note
This is currently a simple clone. In the future, this may be updated to create true isolated child layers with proper parent-child relationships.
Trait Implementations§
Source§impl Clone for LocalStorageLayer
impl Clone for LocalStorageLayer
Source§fn clone(&self) -> LocalStorageLayer
fn clone(&self) -> LocalStorageLayer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for LocalStorageLayer
impl !RefUnwindSafe for LocalStorageLayer
impl Send for LocalStorageLayer
impl Sync for LocalStorageLayer
impl Unpin for LocalStorageLayer
impl UnsafeUnpin for LocalStorageLayer
impl !UnwindSafe for LocalStorageLayer
Blanket Implementations§
Source§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> Self::Output
fn aggregate_filter<P>(self, f: P) -> Self::Output
Source§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
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
Source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
Source§fn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read moreSource§impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
fn into_tuple(self) -> Dest
Source§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<I> RecreateContext<I> for I
impl<I> RecreateContext<I> for I
Source§fn recreate_context(_original_input: I, tail: I) -> I
fn recreate_context(_original_input: I, tail: I) -> I
Source§impl<T, Conn> RunQueryDsl<Conn> for T
impl<T, Conn> RunQueryDsl<Conn> for T
Source§fn execute<'conn, 'query>(
self,
conn: &'conn mut Conn,
) -> <Conn as AsyncConnectionCore>::ExecuteFuture<'conn, 'query>
fn execute<'conn, 'query>( self, conn: &'conn mut Conn, ) -> <Conn as AsyncConnectionCore>::ExecuteFuture<'conn, 'query>
Source§fn load<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>>
fn load<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>>
Source§fn load_stream<'conn, 'query, U>(
self,
conn: &'conn mut Conn,
) -> Self::LoadFuture<'conn>where
Conn: AsyncConnectionCore,
U: 'conn,
Self: LoadQuery<'query, Conn, U> + 'query,
fn load_stream<'conn, 'query, U>(
self,
conn: &'conn mut Conn,
) -> Self::LoadFuture<'conn>where
Conn: AsyncConnectionCore,
U: 'conn,
Self: LoadQuery<'query, Conn, U> + 'query,
Stream] with the returned rows. Read moreSource§fn get_result<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<Self::LoadFuture<'conn>, LoadNext<Pin<Box<Self::Stream<'conn>>>>>
fn get_result<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> AndThen<Self::LoadFuture<'conn>, LoadNext<Pin<Box<Self::Stream<'conn>>>>>
Source§fn get_results<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>>
fn get_results<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>>
Vec with the affected rows. Read moreSource§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
Source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
Source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T. Read moreSource§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.Source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
Source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from.Source§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
Source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T.