pub struct RemoteStorageLayer { /* private fields */ }Expand description
Remote storage layer that lazily fetches state from a live chain.
Provides a cache-through abstraction: reads check the local cache first, and only fetch from the remote RPC when the value isn’t cached. Fetched values are automatically cached for subsequent reads.
§Cloning
RemoteStorageLayer is cheap to clone. Both ForkRpcClient and StorageCache
use internal reference counting (connection pools/Arc), so cloning just increments
reference counts.
§Thread Safety
The layer is Send + Sync and can be shared across async tasks. The underlying
cache handles concurrent access safely.
Implementations§
Source§impl RemoteStorageLayer
impl RemoteStorageLayer
Sourcepub fn new(rpc: ForkRpcClient, cache: StorageCache) -> Self
pub fn new(rpc: ForkRpcClient, cache: StorageCache) -> Self
Create a new remote storage layer.
§Arguments
rpc- RPC client connected to the live chaincache- Storage cache for persisting fetched values
Sourcepub fn rpc(&self) -> &ForkRpcClient
pub fn rpc(&self) -> &ForkRpcClient
Get a reference to the underlying RPC client.
Sourcepub fn cache(&self) -> &StorageCache
pub fn cache(&self) -> &StorageCache
Get a reference to the underlying cache.
Sourcepub fn stats(&self) -> StorageStatsSnapshot
pub fn stats(&self) -> StorageStatsSnapshot
Take a snapshot of the current storage access counters.
Sourcepub fn reset_stats(&self)
pub fn reset_stats(&self)
Reset all storage access counters to zero.
Sourcepub async fn get(
&self,
block_hash: H256,
key: &[u8],
) -> Result<Option<Vec<u8>>, RemoteStorageError>
pub async fn get( &self, block_hash: H256, key: &[u8], ) -> Result<Option<Vec<u8>>, RemoteStorageError>
Get a storage value, fetching from RPC if not cached.
§Returns
Ok(Some(value))- Storage exists with valueOk(None)- Storage key doesn’t exist (empty)Err(_)- RPC or cache error
§Caching Behavior
- If the key is in cache, returns the cached value immediately
- If not cached and the key is >= 32 bytes, speculatively prefetches the first page of keys sharing the same 32-byte prefix (pallet hash + storage item hash). This converts hundreds of individual RPCs into a handful of bulk fetches without risking a full scan of large maps.
- Falls back to individual RPC fetch if the key is short or the speculative prefetch didn’t cover it (key beyond first page).
- Empty storage (key exists but has no value) is cached as
None
Sourcepub async fn get_batch(
&self,
block_hash: H256,
keys: &[&[u8]],
) -> Result<Vec<Option<Vec<u8>>>, RemoteStorageError>
pub async fn get_batch( &self, block_hash: H256, keys: &[&[u8]], ) -> Result<Vec<Option<Vec<u8>>>, RemoteStorageError>
Get multiple storage values in a batch, fetching uncached keys from RPC.
§Arguments
block_hash- The hash of the block being queried.keys- Slice of storage keys to fetch (as byte slices to avoid unnecessary allocations)
§Returns
A vector of optional values, in the same order as the input keys.
§Caching Behavior
- Checks cache for all keys first
- Only fetches uncached keys from RPC
- Caches all fetched values (including empty ones)
- Returns results in the same order as input keys
Sourcepub async fn prefetch_prefix(
&self,
block_hash: H256,
prefix: &[u8],
page_size: u32,
) -> Result<usize, RemoteStorageError>
pub async fn prefetch_prefix( &self, block_hash: H256, prefix: &[u8], page_size: u32, ) -> Result<usize, RemoteStorageError>
Prefetch a range of storage keys by prefix (resumable).
Fetches all keys matching the prefix and caches their values. This operation is resumable - if interrupted, calling it again will continue from where it left off.
§Arguments
block_hash.prefix- Storage key prefix to matchpage_size- Number of keys to fetch per RPC call
§Returns
The total number of keys for this prefix (including previously cached).
Sourcepub async fn prefetch_prefix_single_page(
&self,
block_hash: H256,
prefix: &[u8],
page_size: u32,
) -> Result<usize, RemoteStorageError>
pub async fn prefetch_prefix_single_page( &self, block_hash: H256, prefix: &[u8], page_size: u32, ) -> Result<usize, RemoteStorageError>
Fetch a single page of keys for a prefix and cache their values.
Unlike prefetch_prefix, this fetches only the first
page of keys (up to page_size) without looping through subsequent pages.
This keeps the cost bounded regardless of how many keys exist under the prefix.
Records scan progress so that subsequent calls to prefetch_prefix can
resume from where this left off.
Sourcepub async fn get_keys(
&self,
block_hash: H256,
prefix: &[u8],
) -> Result<Vec<Vec<u8>>, RemoteStorageError>
pub async fn get_keys( &self, block_hash: H256, prefix: &[u8], ) -> Result<Vec<Vec<u8>>, RemoteStorageError>
Get all keys for a prefix, fetching from RPC if not fully cached.
This is a convenience method that:
- Ensures the prefix is fully scanned (calls
Self::prefetch_prefixif needed) - Returns all cached keys matching the prefix
Useful for enumerating all entries in a storage map (e.g., all accounts in a balances pallet).
§Arguments
block_hash- Block hash to query atprefix- Storage key prefix to match (typically a pallet + storage item prefix)
§Returns
All keys matching the prefix at the specified block hash.
§Performance
First call may be slow if the prefix hasn’t been scanned yet. Subsequent calls return cached data immediately.
Sourcepub async fn fetch_and_cache_block_by_number(
&self,
block_number: u32,
) -> Result<Option<BlockRow>, RemoteStorageError>
pub async fn fetch_and_cache_block_by_number( &self, block_number: u32, ) -> Result<Option<BlockRow>, RemoteStorageError>
Fetch a block by number from the remote RPC and cache it.
This method fetches the block data for the given block number and caches the block metadata in the cache.
§Arguments
block_number- The block number to fetch and cache
§Returns
Ok(Some(block_row))- Block was fetched and cached successfullyOk(None)- Block number doesn’t existErr(_)- RPC or cache error
§Caching Behavior
- Fetches block hash and data from block number using
chain_getBlockHashandchain_getBlock - Caches block metadata (hash, number, parent_hash, header) in the cache
- If block is already cached, this will update the cache entry
Sourcepub async fn next_key(
&self,
block_hash: H256,
prefix: &[u8],
key: &[u8],
) -> Result<Option<Vec<u8>>, RemoteStorageError>
pub async fn next_key( &self, block_hash: H256, prefix: &[u8], key: &[u8], ) -> Result<Option<Vec<u8>>, RemoteStorageError>
Get the next key after the given key that starts with the prefix.
This method is used for key enumeration during runtime execution. Before hitting the RPC, it checks whether a complete prefix scan exists in the cache for the queried prefix (or parent prefixes at 32 or 16 bytes). If so, the answer is served from the local SQLite cache, avoiding an RPC round-trip entirely.
§Arguments
block_hash- Block hash to query atprefix- 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 prefix
Sourcepub async fn block_body(
&self,
hash: H256,
) -> Result<Option<Vec<Vec<u8>>>, RemoteStorageError>
pub async fn block_body( &self, hash: H256, ) -> Result<Option<Vec<Vec<u8>>>, RemoteStorageError>
Get block body (extrinsics) by hash from the remote chain.
§Returns
Ok(Some(extrinsics))- Block found, returns list of encoded extrinsicsOk(None)- Block not found
Sourcepub async fn block_header(
&self,
hash: H256,
) -> Result<Option<Vec<u8>>, RemoteStorageError>
pub async fn block_header( &self, hash: H256, ) -> Result<Option<Vec<u8>>, RemoteStorageError>
Get block header by hash from the remote chain.
§Returns
Ok(Some(header_bytes))- Encoded header bytesOk(None)- Block not found on the remote chainErr(..)- Transport/connection error (caller should retry or reconnect)
Sourcepub async fn block_hash_by_number(
&self,
block_number: u32,
) -> Result<Option<H256>, RemoteStorageError>
pub async fn block_hash_by_number( &self, block_number: u32, ) -> Result<Option<H256>, RemoteStorageError>
Get block hash by block number from the remote chain.
§Returns
Ok(Some(hash))- Block hash at the given numberOk(None)- Block number not found
Sourcepub async fn block_number_by_hash(
&self,
hash: H256,
) -> Result<Option<u32>, RemoteStorageError>
pub async fn block_number_by_hash( &self, hash: H256, ) -> Result<Option<u32>, RemoteStorageError>
Get block number by hash from the remote chain.
This method checks the persistent SQLite cache first before hitting RPC. Results are cached for future lookups.
§Returns
Ok(Some(number))- Block number for the given hashOk(None)- Block not found
Sourcepub async fn parent_hash(
&self,
hash: H256,
) -> Result<Option<H256>, RemoteStorageError>
pub async fn parent_hash( &self, hash: H256, ) -> Result<Option<H256>, RemoteStorageError>
Get parent hash of a block from the remote chain.
This method checks the persistent SQLite cache first before hitting RPC. Results are cached for future lookups.
§Returns
Ok(Some(parent_hash))- Parent hash of the blockOk(None)- Block not found
Sourcepub async fn block_by_number(
&self,
block_number: u32,
) -> Result<Option<(H256, Block<SubstrateConfig>)>, RemoteStorageError>
pub async fn block_by_number( &self, block_number: u32, ) -> Result<Option<(H256, Block<SubstrateConfig>)>, RemoteStorageError>
Get full block data (hash and block) by number from the remote chain.
§Returns
Ok(Some((hash, block)))- Block foundOk(None)- Block number not found
Sourcepub async fn finalized_head(&self) -> Result<H256, RemoteStorageError>
pub async fn finalized_head(&self) -> Result<H256, RemoteStorageError>
Get the latest finalized block hash from the remote chain.
Trait Implementations§
Source§impl Clone for RemoteStorageLayer
impl Clone for RemoteStorageLayer
Source§fn clone(&self) -> RemoteStorageLayer
fn clone(&self) -> RemoteStorageLayer
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 RemoteStorageLayer
impl !RefUnwindSafe for RemoteStorageLayer
impl Send for RemoteStorageLayer
impl Sync for RemoteStorageLayer
impl Unpin for RemoteStorageLayer
impl UnsafeUnpin for RemoteStorageLayer
impl !UnwindSafe for RemoteStorageLayer
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.