pub struct StorageCache { /* private fields */ }Expand description
SQLite-backed persistent cache for storage values.
Enables fast restarts without re-fetching all data from live chains and reduces load on public RPC endpoints.
Implementations§
Source§impl StorageCache
impl StorageCache
Sourcepub async fn open(maybe_path: Option<&Path>) -> Result<Self, CacheError>
pub async fn open(maybe_path: Option<&Path>) -> Result<Self, CacheError>
Open or create a cache database at the specified path.
Creates the parent directory if it doesn’t exist.
Sourcepub async fn in_memory() -> Result<Self, CacheError>
pub async fn in_memory() -> Result<Self, CacheError>
Open an in-memory cache.
Creates a fresh in-memory SQLite database and runs all migrations to set up the storage and blocks tables.
Sourcepub async fn get_storage(
&self,
block_hash: H256,
key: &[u8],
) -> Result<Option<Option<Vec<u8>>>, CacheError>
pub async fn get_storage( &self, block_hash: H256, key: &[u8], ) -> Result<Option<Option<Vec<u8>>>, CacheError>
Get a cached storage value.
§Returns
Ok(Some(Some(value)))- Cached with a value.Ok(Some(None))- Cached as empty (storage key exists but has no value).Ok(None)- Not in cache (unknown).
Sourcepub async fn set_storage(
&self,
block_hash: H256,
key: &[u8],
value: Option<&[u8]>,
) -> Result<(), CacheError>
pub async fn set_storage( &self, block_hash: H256, key: &[u8], value: Option<&[u8]>, ) -> Result<(), CacheError>
Cache a storage value.
§Arguments
block_hash- The block hash this storage is fromkey- The storage keyvalue- The storage value, or None if the key has no value (empty)
Sourcepub async fn get_storage_batch(
&self,
block_hash: H256,
keys: &[&[u8]],
) -> Result<Vec<Option<Option<Vec<u8>>>>, CacheError>
pub async fn get_storage_batch( &self, block_hash: H256, keys: &[&[u8]], ) -> Result<Vec<Option<Option<Vec<u8>>>>, CacheError>
Get multiple cached storage values in a batch.
Returns results in the same order as the input keys.
Sourcepub async fn set_storage_batch(
&self,
block_hash: H256,
entries: &[(&[u8], Option<&[u8]>)],
) -> Result<(), CacheError>
pub async fn set_storage_batch( &self, block_hash: H256, entries: &[(&[u8], Option<&[u8]>)], ) -> Result<(), CacheError>
Cache multiple storage values in a batch.
Uses a transaction for efficiency.
Sourcepub async fn get_local_key(
&self,
key: &[u8],
) -> Result<Option<LocalKeyRow>, CacheError>
pub async fn get_local_key( &self, key: &[u8], ) -> Result<Option<LocalKeyRow>, CacheError>
Get a local key’s ID from the local_keys table.
§Returns
Ok(Some(key_row))- Key exists with its IDOk(None)- Key not in local_keys table
Sourcepub async fn insert_local_key(&self, key: &[u8]) -> Result<i32, CacheError>
pub async fn insert_local_key(&self, key: &[u8]) -> Result<i32, CacheError>
Insert a new key into local_keys and return its ID.
If the key already exists, returns the existing ID.
Sourcepub async fn get_local_value_at_block(
&self,
key: &[u8],
block_number: u32,
) -> Result<Option<Option<Vec<u8>>>, CacheError>
pub async fn get_local_value_at_block( &self, key: &[u8], block_number: u32, ) -> Result<Option<Option<Vec<u8>>>, CacheError>
Get a local storage value valid at a specific block number.
Queries the local_values table for a value that is valid at the given block: valid_from <= block_number AND (valid_until IS NULL OR valid_until > block_number)
§Returns
Ok(Some(Some(value)))- Value found with dataOk(Some(None))- Value found but explicitly deleted (NULL in DB)Ok(None)- No value valid at this block (no row found)
Sourcepub async fn get_local_values_at_block_batch(
&self,
keys: &[&[u8]],
block_number: u32,
) -> Result<Vec<Option<Option<Vec<u8>>>>, CacheError>
pub async fn get_local_values_at_block_batch( &self, keys: &[&[u8]], block_number: u32, ) -> Result<Vec<Option<Option<Vec<u8>>>>, CacheError>
Get multiple local storage values valid at a specific block number.
Returns results in the same order as the input keys.
Some(Some(value))- Value found with dataSome(None)- Value found but explicitly deleted (NULL in DB)None- No value valid at this block (no row found)
Sourcepub async fn get_local_keys_at_block(
&self,
prefix: &[u8],
block_number: u32,
) -> Result<Vec<Vec<u8>>, CacheError>
pub async fn get_local_keys_at_block( &self, prefix: &[u8], block_number: u32, ) -> Result<Vec<Vec<u8>>, CacheError>
Get all locally-modified keys matching a prefix that existed at a specific block.
Joins local_keys with local_values to find keys where:
- The key starts with
prefix - A value entry is valid at
block_number(valid_from <= block AND (valid_until IS NULL OR valid_until > block)) - The value is not NULL (i.e., the key was not deleted at that block)
Returns a sorted list of matching keys.
Sourcepub async fn get_local_deleted_keys_at_block(
&self,
prefix: &[u8],
block_number: u32,
) -> Result<Vec<Vec<u8>>, CacheError>
pub async fn get_local_deleted_keys_at_block( &self, prefix: &[u8], block_number: u32, ) -> Result<Vec<Vec<u8>>, CacheError>
Get all locally-deleted keys matching a prefix at a specific block.
Returns keys where the value entry valid at block_number has a NULL value
(explicitly deleted). This is needed to exclude deleted keys from merged
remote + local key enumeration.
Sourcepub async fn insert_local_value(
&self,
key_id: i32,
value: Option<&[u8]>,
valid_from: u32,
) -> Result<(), CacheError>
pub async fn insert_local_value( &self, key_id: i32, value: Option<&[u8]>, valid_from: u32, ) -> Result<(), CacheError>
Insert a new local value entry.
§Arguments
key_id- The key ID from local_keys tablevalue- The value bytes, or None to record a deletionvalid_from- Block number when this value becomes valid
Sourcepub async fn close_local_value(
&self,
key_id: i32,
valid_until: u32,
) -> Result<(), CacheError>
pub async fn close_local_value( &self, key_id: i32, valid_until: u32, ) -> Result<(), CacheError>
Close the currently open local value entry (set valid_until).
Finds the entry for this key_id where valid_until IS NULL and sets it.
Sourcepub async fn commit_local_changes(
&self,
entries: &[(&[u8], Option<&[u8]>)],
block_number: u32,
) -> Result<(), CacheError>
pub async fn commit_local_changes( &self, entries: &[(&[u8], Option<&[u8]>)], block_number: u32, ) -> Result<(), CacheError>
Commit a batch of local storage changes in a single transaction.
For each entry: upserts the key into local_keys, closes the previous value
(sets valid_until), and inserts the new value. Wrapping everything in one
transaction avoids per-operation fsync overhead, reducing commit time from
tens of seconds to sub-second.
Sourcepub async fn clear_local_storage(&self) -> Result<(), CacheError>
pub async fn clear_local_storage(&self) -> Result<(), CacheError>
Clear all local storage data (both local_keys and local_values tables).
This removes all locally tracked key-value pairs and their validity history. Uses a transaction to ensure both tables are cleared atomically.
Sourcepub async fn cache_block(
&self,
hash: H256,
number: u32,
parent_hash: H256,
header: &[u8],
) -> Result<(), CacheError>
pub async fn cache_block( &self, hash: H256, number: u32, parent_hash: H256, header: &[u8], ) -> Result<(), CacheError>
Cache block metadata.
Sourcepub async fn get_block(
&self,
hash: H256,
) -> Result<Option<BlockRow>, CacheError>
pub async fn get_block( &self, hash: H256, ) -> Result<Option<BlockRow>, CacheError>
Get cached block metadata.
Sourcepub async fn get_block_by_number(
&self,
block_number: u32,
) -> Result<Option<BlockRow>, CacheError>
pub async fn get_block_by_number( &self, block_number: u32, ) -> Result<Option<BlockRow>, CacheError>
Get cached block metadata by block number.
Sourcepub async fn clear_block(&self, hash: H256) -> Result<(), CacheError>
pub async fn clear_block(&self, hash: H256) -> Result<(), CacheError>
Clear all cached data for a specific block.
Sourcepub async fn get_prefix_scan_progress(
&self,
block_hash: H256,
prefix: &[u8],
) -> Result<Option<PrefixScanProgress>, CacheError>
pub async fn get_prefix_scan_progress( &self, block_hash: H256, prefix: &[u8], ) -> Result<Option<PrefixScanProgress>, CacheError>
Get the progress of a prefix scan operation.
§Returns
Ok(Some(progress))- Scan has been started, returns progress infoOk(None)- No scan has been started for this prefix
Sourcepub async fn update_prefix_scan(
&self,
block_hash: H256,
prefix: &[u8],
last_key: &[u8],
is_complete: bool,
) -> Result<(), CacheError>
pub async fn update_prefix_scan( &self, block_hash: H256, prefix: &[u8], last_key: &[u8], is_complete: bool, ) -> Result<(), CacheError>
Update the progress of a prefix scan operation (upsert).
Creates a new progress record or updates an existing one. Uses SQLite’s
ON CONFLICT DO UPDATE for atomic upsert semantics.
§Arguments
block_hash- The block hash being scannedprefix- The storage prefix being scannedlast_key- The last key that was processedis_complete- Whether the scan has finished
Sourcepub async fn get_keys_by_prefix(
&self,
block_hash: H256,
prefix: &[u8],
) -> Result<Vec<Vec<u8>>, CacheError>
pub async fn get_keys_by_prefix( &self, block_hash: H256, prefix: &[u8], ) -> Result<Vec<Vec<u8>>, CacheError>
Get all cached keys matching a prefix.
Uses a range query (key >= prefix AND key < prefix+1) for efficient
prefix matching on SQLite’s B-tree index. This is more performant than
LIKE or GLOB patterns for binary key prefixes.
Sourcepub async fn next_key_from_cache(
&self,
block_hash: H256,
prefix: &[u8],
key: &[u8],
) -> Result<Option<Vec<u8>>, CacheError>
pub async fn next_key_from_cache( &self, block_hash: H256, prefix: &[u8], key: &[u8], ) -> Result<Option<Vec<u8>>, CacheError>
Find the next cached key after key that matches prefix.
Uses a range query (key > current AND key >= prefix AND key < prefix+1)
for efficient lookup on SQLite’s B-tree index.
§Returns
Ok(Some(next_key))- The next key afterkeymatching the prefixOk(None)- No more keys with this prefix afterkey
Sourcepub async fn count_keys_by_prefix(
&self,
block_hash: H256,
prefix: &[u8],
) -> Result<usize, CacheError>
pub async fn count_keys_by_prefix( &self, block_hash: H256, prefix: &[u8], ) -> Result<usize, CacheError>
Count cached keys matching a prefix.
Uses the same range query strategy as Self::get_keys_by_prefix for
efficient counting without loading key data.
Trait Implementations§
Source§impl Clone for StorageCache
impl Clone for StorageCache
Source§fn clone(&self) -> StorageCache
fn clone(&self) -> StorageCache
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 StorageCache
impl !RefUnwindSafe for StorageCache
impl Send for StorageCache
impl Sync for StorageCache
impl Unpin for StorageCache
impl UnsafeUnpin for StorageCache
impl !UnwindSafe for StorageCache
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.