pub struct Blockchain { /* private fields */ }Expand description
The blockchain manager for a forked chain.
Blockchain is the main entry point for creating local forks of live
Polkadot SDK chains. It manages the fork lifecycle, block building,
and provides APIs for querying state and executing runtime calls.
§Creating a Fork
Use Blockchain::fork to create a new fork from a live chain:
let blockchain = Blockchain::fork(&endpoint, None).await?;§Block Building
Build blocks using build_block or
build_empty_block:
// Build a block with user extrinsics
let block = blockchain.build_block(vec![signed_extrinsic]).await?;
// Build an empty block (just inherents)
let block = blockchain.build_empty_block().await?;§Querying State
Query storage at the current head or at a specific block:
// At head
let value = blockchain.storage(&key).await?;
// At a specific block
let value = blockchain.storage_at(block_hash, &key).await?;§Thread Safety
Blockchain is Send + Sync and can be safely shared across async tasks.
Internal state is protected by RwLock.
Implementations§
Source§impl Blockchain
impl Blockchain
Sourcepub async fn fork(
endpoint: &Url,
cache_path: Option<&Path>,
) -> Result<Arc<Self>, BlockchainError>
pub async fn fork( endpoint: &Url, cache_path: Option<&Path>, ) -> Result<Arc<Self>, BlockchainError>
Create a new blockchain forked from a live chain.
This connects to the live chain, fetches the fork point block, initializes the runtime executor, and detects the chain type.
§Arguments
endpoint- RPC endpoint URL of the live chaincache_path- Optional path for persistent SQLite cache. IfNone, an in-memory cache is used.
§Returns
A new Blockchain instance ready for block building.
§Example
use pop_fork::Blockchain;
use std::path::Path;
use url::Url;
let endpoint: Url = "wss://rpc.polkadot.io".parse()?;
// With in-memory cache
let blockchain = Blockchain::fork(&endpoint, None).await?;
// With persistent cache
let blockchain = Blockchain::fork(&endpoint, Some(Path::new("./cache.sqlite"))).await?;Sourcepub async fn fork_at(
endpoint: &Url,
cache_path: Option<&Path>,
fork_point: Option<BlockForkPoint>,
) -> Result<Arc<Self>, BlockchainError>
pub async fn fork_at( endpoint: &Url, cache_path: Option<&Path>, fork_point: Option<BlockForkPoint>, ) -> Result<Arc<Self>, BlockchainError>
Create a new blockchain forked from a live chain at a specific block.
Similar to fork, but allows specifying the exact
block to fork from.
§Arguments
endpoint- RPC endpoint URL of the live chaincache_path- Optional path for persistent SQLite cachefork_point- Block number or hash to fork from. IfNone, uses the latest finalized block.
§Example
// Fork at a specific block number
let blockchain = Blockchain::fork_at(&endpoint, None, Some(12345678.into())).await?;
// Fork at a specific block hash
let blockchain = Blockchain::fork_at(&endpoint, None, Some(block_hash.into())).await?;Sourcepub async fn fork_with_config(
endpoint: &Url,
cache_path: Option<&Path>,
fork_point: Option<BlockForkPoint>,
executor_config: ExecutorConfig,
) -> Result<Arc<Self>, BlockchainError>
pub async fn fork_with_config( endpoint: &Url, cache_path: Option<&Path>, fork_point: Option<BlockForkPoint>, executor_config: ExecutorConfig, ) -> Result<Arc<Self>, BlockchainError>
Create a new blockchain forked from a live chain with custom executor configuration.
This is the most flexible fork method, allowing customization of both the fork point and the executor configuration.
§Arguments
endpoint- RPC endpoint URL of the live chaincache_path- Optional path for persistent SQLite cachefork_point- Block number or hash to fork from. IfNone, uses the latest finalized block.executor_config- Configuration for the runtime executor
§Example
use pop_fork::{Blockchain, ExecutorConfig, SignatureMockMode};
// Fork with signature mocking enabled (useful for testing)
let config = ExecutorConfig {
signature_mock: SignatureMockMode::AlwaysValid,
..Default::default()
};
let blockchain = Blockchain::fork_with_config(&endpoint, None, None, config).await?;Sourcepub async fn warmup(self: &Arc<Self>)
pub async fn warmup(self: &Arc<Self>)
Run background warmup to pre-cache expensive resources.
This method is designed to be spawned as a background task immediately after forking. It pre-populates caches that would otherwise cause a cold-start penalty on the first block build:
-
WASM prototype compilation (~2-5s for large runtimes like Asset Hub). The compiled prototype is stored in
warm_prototypefor reuse by the firstbuild_block()call. -
Storage prefetch (~1-2s). Batch-fetches all
StorageValuekeys and the first page of each pallet’s storage map, populating the remote cache. -
Inherent provider warmup. Calls
warmup()on each registered provider (e.g.TimestampInherentcaches the slot duration to avoid a separate WASM execution during block building).
If a block is built before warmup finishes, the builder falls back to its
normal (non-cached) path. The Mutex/OnceCell guards ensure no races.
Sourcepub fn chain_name(&self) -> &str
pub fn chain_name(&self) -> &str
Get the chain name.
Sourcepub fn chain_type(&self) -> &ChainType
pub fn chain_type(&self) -> &ChainType
Get the chain type.
Sourcepub fn fork_point(&self) -> H256
pub fn fork_point(&self) -> H256
Get the fork point block hash.
Sourcepub fn fork_point_number(&self) -> u32
pub fn fork_point_number(&self) -> u32
Get the fork point block number.
Sourcepub async fn genesis_hash(&self) -> Result<String, BlockchainError>
pub async fn genesis_hash(&self) -> Result<String, BlockchainError>
Get the genesis hash, formatted as a hex string with “0x” prefix.
This method lazily fetches and caches the genesis hash on first call. The cache is per-instance, so each forked chain maintains its own value even when multiple forks run in the same process.
§Returns
The genesis hash as “0x” prefixed hex string, or an error if fetching fails.
Sourcepub async fn chain_properties(&self) -> Option<Value>
pub async fn chain_properties(&self) -> Option<Value>
Get the chain properties.
This method lazily fetches and caches the chain properties on first call. The cache is per-instance, so each forked chain maintains its own value even when multiple forks run in the same process.
§Returns
The chain properties as JSON, or None if not available.
Sourcepub fn subscribe_events(&self) -> Receiver<BlockchainEvent>
pub fn subscribe_events(&self) -> Receiver<BlockchainEvent>
Subscribe to blockchain events.
Returns a receiver that will get events when blocks are built. Use this for implementing reactive RPC subscriptions.
§Example
let mut receiver = blockchain.subscribe_events();
tokio::spawn(async move {
while let Ok(event) = receiver.recv().await {
match event {
BlockchainEvent::NewBlock { hash, number, .. } => {
println!("New block #{} ({:?})", number, hash);
}
}
}
});Sourcepub async fn head_number(&self) -> u32
pub async fn head_number(&self) -> u32
Get the current head block number.
Sourcepub async fn block_body(
&self,
hash: H256,
) -> Result<Option<Vec<Vec<u8>>>, BlockchainError>
pub async fn block_body( &self, hash: H256, ) -> Result<Option<Vec<Vec<u8>>>, BlockchainError>
Get block body (extrinsics) by hash.
This method searches for the block in three places:
- The current head block
- Locally-built blocks (traversing the parent chain)
- The remote chain (for blocks at or before the fork point)
§Arguments
hash- The block hash to query
§Returns
The block’s extrinsics as raw bytes, or None if the block is not found.
Sourcepub async fn block_header(
&self,
hash: H256,
) -> Result<Option<Vec<u8>>, BlockchainError>
pub async fn block_header( &self, hash: H256, ) -> Result<Option<Vec<u8>>, BlockchainError>
Get block header by hash.
This method searches for the block in three places:
- Locally-built blocks (traversing the parent chain)
- The fork point block
- The remote chain (for blocks at or before the fork point)
§Arguments
hash- The block hash to query
§Returns
The SCALE-encoded block header, or None if the block is not found.
Sourcepub async fn block_hash_at(
&self,
block_number: u32,
) -> Result<Option<H256>, BlockchainError>
pub async fn block_hash_at( &self, block_number: u32, ) -> Result<Option<H256>, BlockchainError>
Get block hash by block number.
This method searches for the block in three places:
- Locally-built blocks (traversing the parent chain from head)
- The fork point block
- The remote chain (for blocks before the fork point)
§Arguments
block_number- The block number to query
§Returns
The block hash, or None if the block number doesn’t exist.
Sourcepub async fn block_number_by_hash(
&self,
hash: H256,
) -> Result<Option<u32>, BlockchainError>
pub async fn block_number_by_hash( &self, hash: H256, ) -> Result<Option<u32>, BlockchainError>
Get block number by block hash.
This method searches for the block in two places:
- Locally-built blocks (traversing the parent chain from head)
- The remote chain (for blocks at or before the fork point)
§Arguments
hash- The block hash to query
§Returns
The block number, or None if the block hash doesn’t exist.
Sourcepub async fn block_parent_hash(
&self,
hash: H256,
) -> Result<Option<H256>, BlockchainError>
pub async fn block_parent_hash( &self, hash: H256, ) -> Result<Option<H256>, BlockchainError>
Get parent hash of a block by its hash.
This method searches for the block in two places:
- Locally-built blocks (traversing the parent chain from head)
- The remote chain (for blocks at or before the fork point)
§Arguments
hash- The block hash to query
§Returns
The parent block hash, or None if the block hash doesn’t exist.
Sourcepub async fn build_block(
&self,
extrinsics: Vec<Vec<u8>>,
) -> Result<BuildBlockResult, BlockchainError>
pub async fn build_block( &self, extrinsics: Vec<Vec<u8>>, ) -> Result<BuildBlockResult, BlockchainError>
Build a new block with the given extrinsics.
This creates a new block on top of the current head, applying:
- Inherent extrinsics (timestamp, parachain validation data, etc.)
- User-provided extrinsics
The new block becomes the new head.
§Arguments
extrinsics- User extrinsics to include in the block
§Returns
A BuildBlockResult containing the newly created block and information
about which extrinsics were successfully included vs which failed.
§Example
let extrinsic = /* create signed extrinsic */;
let result = blockchain.build_block(vec![extrinsic]).await?;
println!("New block: #{} ({:?})", result.block.number, result.block.hash);
println!("Included: {}, Failed: {}", result.included.len(), result.failed.len());Sourcepub async fn build_empty_block(&self) -> Result<Block, BlockchainError>
pub async fn build_empty_block(&self) -> Result<Block, BlockchainError>
Build an empty block (just inherents, no user extrinsics).
This is useful for advancing the chain state without any user transactions.
§Returns
The newly created block.
Sourcepub async fn storage_at(
&self,
block_number: u32,
key: &[u8],
) -> Result<Option<Vec<u8>>, BlockchainError>
pub async fn storage_at( &self, block_number: u32, key: &[u8], ) -> Result<Option<Vec<u8>>, BlockchainError>
Sourcepub async fn storage_keys_paged(
&self,
prefix: &[u8],
count: u32,
start_key: Option<&[u8]>,
at: Option<H256>,
) -> Result<Vec<Vec<u8>>, BlockchainError>
pub async fn storage_keys_paged( &self, prefix: &[u8], count: u32, start_key: Option<&[u8]>, at: Option<H256>, ) -> Result<Vec<Vec<u8>>, BlockchainError>
Get paginated storage keys matching a prefix at a given block.
If at is None, defaults to the current head block hash so that
newly created keys are visible to callers such as polkadot.js.
For fork-local blocks, the full key set is obtained by merging remote keys (at the fork point) with local modifications, then applying pagination. For pre-fork blocks, delegates to the upstream RPC.
Sourcepub async fn storage_keys_by_prefix(
&self,
prefix: &[u8],
at: H256,
) -> Result<Vec<Vec<u8>>, BlockchainError>
pub async fn storage_keys_by_prefix( &self, prefix: &[u8], at: H256, ) -> Result<Vec<Vec<u8>>, BlockchainError>
Get all storage keys matching a prefix, with prefetching. Enumerate all storage keys matching a prefix at a given block.
For pre-fork blocks, delegates to the remote RPC’s get_keys method.
For fork-local blocks, merges remote keys (at the fork point) with local
modifications so that keys added or deleted after the fork are visible.
at is the block hash whose state should be scanned for keys.
Sourcepub async fn call_at_block(
&self,
hash: H256,
method: &str,
args: &[u8],
) -> Result<Option<Vec<u8>>, BlockchainError>
pub async fn call_at_block( &self, hash: H256, method: &str, args: &[u8], ) -> Result<Option<Vec<u8>>, BlockchainError>
Execute a runtime call at a specific block hash.
§Arguments
hash- The block hash to execute atmethod- Runtime API method name (e.g., “Core_version”)args- SCALE-encoded arguments
§Returns
Ok(Some(result))- Call succeeded at the specified blockOk(None)- Block hash not foundErr(_)- Call failed (runtime error, storage error, etc.)
Sourcepub async fn storage_batch(
&self,
at: H256,
keys: &[&[u8]],
) -> Result<Vec<Option<Vec<u8>>>, BlockchainError>
pub async fn storage_batch( &self, at: H256, keys: &[&[u8]], ) -> Result<Vec<Option<Vec<u8>>>, BlockchainError>
Batch-fetch storage values from the upstream at a given block.
Uses the remote storage layer’s batch fetch, which checks the cache first and fetches only uncached keys in a single upstream RPC call. This is significantly faster than fetching each key individually.
Automatically reconnects to the upstream if the connection has dropped.
Sourcepub async fn proxy_state_call(
&self,
method: &str,
args: &[u8],
at: H256,
) -> Result<Vec<u8>, BlockchainError>
pub async fn proxy_state_call( &self, method: &str, args: &[u8], at: H256, ) -> Result<Vec<u8>, BlockchainError>
Proxy a runtime API call to the upstream RPC endpoint.
This forwards the call to the upstream node at the given block, which has a JIT-compiled runtime and handles computationally expensive calls (like metadata generation) much faster than the local WASM interpreter.
Automatically reconnects if the upstream connection has dropped.
Sourcepub async fn validate_extrinsic(
&self,
extrinsic: &[u8],
) -> Result<ValidTransaction, TransactionValidityError>
pub async fn validate_extrinsic( &self, extrinsic: &[u8], ) -> Result<ValidTransaction, TransactionValidityError>
Validate an extrinsic before pool submission.
Calls TaggedTransactionQueue_validate_transaction runtime API to check
if the extrinsic is valid for inclusion in a future block.
§Arguments
extrinsic- The encoded extrinsic to validate
§Returns
Ok(ValidTransaction)- Transaction is valid with priority/dependency infoErr(TransactionValidityError)- Transaction is invalid or unknown
§Example
match blockchain.validate_extrinsic(&extrinsic_bytes).await {
Ok(valid) => println!("Valid with priority {}", valid.priority),
Err(TransactionValidityError::Invalid(inv)) => {
println!("Invalid: {:?}", inv);
}
Err(TransactionValidityError::Unknown(unk)) => {
println!("Unknown validity: {:?}", unk);
}
}Sourcepub async fn initialize_dev_accounts(&self) -> Result<(), BlockchainError>
pub async fn initialize_dev_accounts(&self) -> Result<(), BlockchainError>
Fund well-known dev accounts and optionally set sudo.
Detects the chain type from the isEthereum chain property:
- Ethereum chains: funds both Substrate (Alice, Bob, …) and Ethereum (Alith, Baltathar, …) dev accounts for compatibility.
- Substrate chains: funds Substrate dev accounts only.
For each account:
- If it already exists on-chain, patches its free balance
- If it does not exist, creates a fresh
AccountInfo
If the chain has a Sudo pallet, sets sudo to a dev account matching the runtime’s
account-id width (20-byte or 32-byte), with first-account fallback.
Sourcepub async fn clear_local_storage(&self) -> Result<(), CacheError>
pub async fn clear_local_storage(&self) -> Result<(), CacheError>
Clear all locally tracked storage data from the cache.
This removes all key-value pairs that were created during block building
(stored in the local_keys and local_values tables). Remote chain data
that was fetched and cached remains intact.
Call this during shutdown to clean up local storage state.
§Returns
Ok(()) on success, or a cache error if the operation fails.
Auto Trait Implementations§
impl !Freeze for Blockchain
impl !RefUnwindSafe for Blockchain
impl Send for Blockchain
impl Sync for Blockchain
impl Unpin for Blockchain
impl UnsafeUnpin for Blockchain
impl !UnwindSafe for Blockchain
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> 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.