Skip to main content

SurfnetSvmLocker

Struct SurfnetSvmLocker 

Source
pub struct SurfnetSvmLocker(pub Arc<RwLock<SurfnetSvm>>);
Expand description

Helper function to apply an override to a JSON value using dot notation path

§Arguments

  • json - The JSON value to modify
  • path - Dot-separated path to the field (e.g., “price_message.price”)
  • value - The new value to set

§Returns

Result indicating success or error

Tuple Fields§

§0: Arc<RwLock<SurfnetSvm>>

Implementations§

Source§

impl SurfnetSvmLocker

Functions for reading and writing to the underlying SurfnetSvm instance

Source

pub fn shutdown(&self)

Explicitly shutdown the SVM, performing cleanup like WAL checkpoint for SQLite. This should be called before the application exits to ensure data is persisted.

Source

pub fn with_svm_reader<T, F>(&self, reader: F) -> T
where F: FnOnce(&SurfnetSvm) -> T + Send + Sync,

Executes a read-only operation on the underlying SurfnetSvm by acquiring a blocking read lock. Accepts a closure that receives a shared reference to SurfnetSvm and returns a value.

§Returns

The result produced by the closure.

Source

pub fn with_svm_writer<T, F>(&self, writer: F) -> T
where F: FnOnce(&mut SurfnetSvm) -> T + Send + Sync, T: Send + 'static,

Executes a write operation on the underlying SurfnetSvm by acquiring a blocking write lock. Accepts a closure that receives a mutable reference to SurfnetSvm and returns a value.

§Returns

The result produced by the closure.

Source§

impl SurfnetSvmLocker

Functions for creating and initializing the underlying SurfnetSvm instance

Source

pub fn new(svm: SurfnetSvm) -> Self

Constructs a new SurfnetSvmLocker wrapping the given SurfnetSvm instance.

Source

pub async fn initialize( &self, remote_ctx: &Option<SurfnetRemoteClient>, ) -> SurfpoolResult<()>

Initializes the locked SurfnetSvm with remote-derived startup state when available.

Source§

impl SurfnetSvmLocker

Functions for getting accounts from the underlying SurfnetSvm instance or remote client

Source

pub fn get_account_local( &self, pubkey: &Pubkey, ) -> SvmAccessContext<GetAccountResult>

Retrieves a local account from the SVM cache, returning a contextualized result.

Source

pub async fn get_account_local_then_remote( &self, client: &SurfnetRemoteClient, pubkey: &Pubkey, commitment_config: CommitmentConfig, ) -> SurfpoolContextualizedResult<GetAccountResult>

Attempts local retrieval, then fetches from remote if missing, returning a contextualized result.

Does not fetch from remote if the account has been explicitly blocked from remote downloads.

Source

pub async fn get_account( &self, remote_ctx: &Option<(SurfnetRemoteClient, CommitmentConfig)>, pubkey: &Pubkey, factory: Option<AccountFactory>, ) -> SurfpoolContextualizedResult<GetAccountResult>

Retrieves an account, using local or remote based on context, applying a default factory if provided.

Source

pub fn get_multiple_accounts_local( &self, pubkeys: &[Pubkey], ) -> SvmAccessContext<Vec<GetAccountResult>>

Retrieves multiple accounts from local cache, returning a contextualized result.

Source

pub async fn get_multiple_accounts_with_remote_fallback( &self, client: &SurfnetRemoteClient, pubkeys: &[Pubkey], commitment_config: CommitmentConfig, ) -> SurfpoolContextualizedResult<Vec<GetAccountResult>>

Retrieves multiple accounts from local storage, with remote fallback for missing accounts.

Returns accounts in the same order as the input pubkeys array. Accounts found locally are returned as-is; accounts not found locally are fetched from the remote RPC client. Accounts that have been marked offline are not fetched from remote.

Source

pub async fn get_multiple_accounts( &self, remote_ctx: &Option<(SurfnetRemoteClient, CommitmentConfig)>, pubkeys: &[Pubkey], factory: Option<AccountFactory>, ) -> SurfpoolContextualizedResult<Vec<GetAccountResult>>

Retrieves multiple accounts, using local or remote context and applying factory defaults if provided.

Source

pub async fn load_snapshot( &self, snapshot: &BTreeMap<String, Option<AccountSnapshot>>, remote_client: Option<&SurfnetRemoteClient>, commitment_config: CommitmentConfig, ) -> SurfpoolResult<usize>

Loads accounts from a snapshot into the SVM.

This method should be called before geyser plugins start to ensure they receive the account updates with is_startup=true.

§Arguments
  • snapshot - A map of pubkey strings to optional account snapshots.
    • If the value is Some(AccountSnapshot), the account is loaded directly.
    • If the value is None, the account is fetched from the remote RPC (if available).
  • remote_client - Optional remote RPC client to fetch None accounts.
  • commitment_config - Commitment level for remote RPC calls.
§Returns

The number of accounts successfully loaded.

Source

pub fn get_largest_accounts_local( &self, config: RpcLargestAccountsConfig, ) -> SurfpoolContextualizedResult<Vec<RpcAccountBalance>>

Retrieves largest accounts from local cache, returning a contextualized result.

Source

pub async fn get_largest_accounts_local_then_remote( &self, client: &SurfnetRemoteClient, config: RpcLargestAccountsConfig, commitment_config: CommitmentConfig, ) -> SurfpoolContextualizedResult<Vec<RpcAccountBalance>>

Source

pub async fn get_largest_accounts( &self, remote_ctx: &Option<(SurfnetRemoteClient, CommitmentConfig)>, config: RpcLargestAccountsConfig, ) -> SurfpoolContextualizedResult<Vec<RpcAccountBalance>>

Source

pub fn account_to_rpc_keyed_account<T: ReadableAccount + Send + Sync>( &self, pubkey: &Pubkey, account: &T, config: &RpcAccountInfoConfig, token_mint: Option<Pubkey>, ) -> RpcKeyedAccount

Source§

impl SurfnetSvmLocker

Get signatures for Addresses

Source

pub fn get_signatures_for_address_local( &self, pubkey: &Pubkey, config: Option<&RpcSignaturesForAddressConfig>, ) -> SvmAccessContext<Vec<RpcConfirmedTransactionStatusWithSignature>>

Returns local getSignaturesForAddress results in the same newest-first order expected by the Solana RPC.

The implementation has to do more than filter by slot:

  • transactions are ordered by descending slot
  • transactions within the same slot are ordered by their execution order in the block
  • before and until are pagination boundaries in that final ordered stream

To preserve those semantics, we first collect matching transactions, reconstruct their intra-slot ordering from block headers, sort the full result stream, and only then apply the before / until window followed by limit.

Source

pub async fn get_signatures_for_address_local_then_remote( &self, client: &SurfnetRemoteClient, pubkey: &Pubkey, config: Option<&RpcSignaturesForAddressConfig>, ) -> SurfpoolContextualizedResult<Vec<RpcConfirmedTransactionStatusWithSignature>>

Source

pub async fn get_signatures_for_address( &self, remote_ctx: &Option<(SurfnetRemoteClient, ())>, pubkey: &Pubkey, config: Option<&RpcSignaturesForAddressConfig>, ) -> SurfpoolContextualizedResult<Vec<RpcConfirmedTransactionStatusWithSignature>>

Source§

impl SurfnetSvmLocker

Functions for getting transactions from the underlying SurfnetSvm instance or remote client

Source

pub async fn get_transaction( &self, remote_ctx: &Option<SurfnetRemoteClient>, signature: &Signature, config: RpcTransactionConfig, ) -> SurfpoolResult<GetTransactionResult>

Retrieves a transaction by signature, using local or remote based on context.

Source

pub fn store_bundle( &self, bundle_id: String, signatures: Vec<String>, ) -> SurfpoolResult<()>

Stores a bundle’s signatures under the given bundle ID.

Source

pub fn get_bundle(&self, bundle_id: &str) -> Option<Vec<String>>

Retrieves the list of transaction signatures for a previously stored bundle.

Returns None when there is no local entry for bundle_id (or the backing store read fails). This is not an “invalid id” signal: callers such as Jito getBundleStatuses treat None as “no data” and return a null RPC result rather than an error.

Source

pub fn get_transaction_local( &self, signature: &Signature, config: &RpcTransactionConfig, ) -> SurfpoolResult<GetTransactionResult>

Retrieves a transaction from local cache, returning a contextualized result.

Source

pub async fn get_transaction_local_then_remote( &self, client: &SurfnetRemoteClient, signature: &Signature, config: RpcTransactionConfig, ) -> SurfpoolResult<GetTransactionResult>

Retrieves a transaction locally then from remote if missing, returning a contextualized result.

Source§

impl SurfnetSvmLocker

Functions for simulating and processing transactions in the underlying SurfnetSvm instance

Source

pub fn simulate_transaction( &self, transaction: VersionedTransaction, sigverify: bool, ) -> Result<SimulatedTransactionInfo, FailedTransactionMetadata>

Simulates a transaction on the SVM, returning detailed info or failure metadata.

Source

pub fn is_instruction_profiling_enabled(&self) -> bool

Source

pub fn get_profiling_map_capacity(&self) -> usize

Source

pub async fn process_transaction( &self, remote_ctx: &Option<(SurfnetRemoteClient, CommitmentConfig)>, transaction: VersionedTransaction, status_tx: Sender<TransactionStatusEvent>, skip_preflight: bool, sigverify: bool, ) -> SurfpoolResult<()>

Source

pub async fn profile_transaction( &self, remote_ctx: &Option<(SurfnetRemoteClient, CommitmentConfig)>, transaction: VersionedTransaction, tag: Option<String>, ) -> SurfpoolContextualizedResult<Uuid>

Source§

impl SurfnetSvmLocker

Functions for writing account updates to the underlying SurfnetSvm instance

Source

pub fn write_account_update(&self, account_update: GetAccountResult)

Writes a single account update into the SVM state if present.

Source

pub fn write_multiple_account_updates( &self, account_updates: &[GetAccountResult], )

Writes multiple account updates into the SVM state when any are present.

Source

pub fn reset_account( &self, pubkey: Pubkey, include_owned_accounts: bool, ) -> SurfpoolResult<()>

Resets an account in the SVM state for refresh/streaming.

This function coordinates the reset of accounts by removing them from the local cache, allowing them to be fetched fresh from mainnet on the next access. It handles program accounts (including their program data accounts) and can optionally cascade the reset to all accounts owned by a program.

Source

pub async fn reset_network( &self, remote_ctx: &Option<SurfnetRemoteClient>, ) -> SurfpoolResult<()>

Resets SVM state and clears all offline account entries.

This function coordinates the reset of the entire network state. It also clears the offline account set so all accounts can be fetched from mainnet again.

Source

pub async fn insert_offline_account( &self, pubkey: Pubkey, include_owned_accounts: bool, ) -> SurfpoolResult<()>

Marks an account as offline, preventing it from being downloaded from the remote RPC.

When include_owned_accounts is enabled, this also marks accounts as offline that are already known locally. Accounts discovered later through direct remote fetches are rejected lazily if they are owned by an offline owner.

Source

pub fn stream_account( &self, pubkey: Pubkey, include_owned_accounts: bool, ) -> SurfpoolResult<()>

Streams an account by its pubkey.

Source

pub fn get_streamed_accounts(&self) -> Vec<(String, bool)>

Source

pub fn remove_offline_account( &self, pubkey: Pubkey, include_owned_accounts: bool, ) -> SurfpoolResult<()>

Removes an account from the offline account set.

This allows the account to be fetched from mainnet again if requested. This is useful when resetting an account for a refresh/stream operation.

Source

pub fn is_account_offline(&self, pubkey: &Pubkey) -> bool

Returns true if the given pubkey is marked offline.

Source

pub fn get_offline_account_owners(&self) -> Vec<Pubkey>

Gets all owners whose accounts are marked offline.

Source

pub fn register_scenario( &self, scenario: Scenario, slot: Option<Slot>, ) -> SurfpoolResult<()>

Registers a scenario for execution

Source

pub async fn materialize_overrides_for_slot( &self, remote_ctx: &Option<(SurfnetRemoteClient, CommitmentConfig)>, slot: Slot, ) -> SurfpoolResult<()>

Materializes overrides for a specific slot (not necessarily the current slot)

Source§

impl SurfnetSvmLocker

Token account related functions

Source§

impl SurfnetSvmLocker

Token account by delegate related functions

Source§

impl SurfnetSvmLocker

Get largest account related account

Source

pub fn get_token_largest_accounts_local( &self, mint: &Pubkey, ) -> SvmAccessContext<Vec<RpcTokenAccountBalance>>

Source

pub async fn get_token_largest_accounts_local_then_remote( &self, client: &SurfnetRemoteClient, mint: &Pubkey, commitment_config: CommitmentConfig, ) -> SurfpoolContextualizedResult<Vec<RpcTokenAccountBalance>>

Source

pub async fn get_token_largest_accounts( &self, remote_ctx: &Option<(SurfnetRemoteClient, CommitmentConfig)>, mint: &Pubkey, ) -> SurfpoolContextualizedResult<Vec<RpcTokenAccountBalance>>

Fetches the largest token accounts for a specific mint, returning contextualized results.

Source§

impl SurfnetSvmLocker

Address lookup table related functions

Source

pub fn get_pubkeys_from_message( &self, message: &VersionedMessage, all_transaction_lookup_table_addresses: Option<Vec<&Pubkey>>, ) -> Vec<Pubkey>

Extracts pubkeys from a VersionedMessage, resolving address lookup tables as needed.

Source

pub async fn get_loaded_addresses( &self, remote_ctx: &Option<(SurfnetRemoteClient, CommitmentConfig)>, message: &VersionedMessage, ) -> SurfpoolResult<Option<TransactionLoadedAddresses>>

Gets addresses loaded from on-chain lookup tables from a VersionedMessage.

Source

pub async fn get_lookup_table_addresses( &self, remote_ctx: &Option<(SurfnetRemoteClient, CommitmentConfig)>, address_table_lookup: &MessageAddressTableLookup, transaction_loaded_addresses: &mut TransactionLoadedAddresses, ) -> SurfpoolResult<()>

Retrieves loaded addresses from a lookup table account, validating owner and indices.

Source§

impl SurfnetSvmLocker

Profiling helper functions

Source

pub fn estimate_compute_units( &self, transaction: &VersionedTransaction, ) -> SvmAccessContext<ComputeUnitsEstimationResult>

Estimates compute units for a transaction via contextualized simulation.

Source

pub fn get_profile_result( &self, signature_or_uuid: UuidOrSignature, config: &RpcProfileResultConfig, ) -> SurfpoolResult<Option<UiKeyedProfileResult>>

Returns the profile result for a given signature or UUID, and whether it exists in the SVM.

Source

pub fn encode_ui_keyed_profile_result( &self, profile: KeyedProfileResult, config: &RpcProfileResultConfig, ) -> UiKeyedProfileResult

Source

pub fn get_profile_results_by_tag( &self, tag: String, config: &RpcProfileResultConfig, ) -> SurfpoolResult<Option<Vec<UiKeyedProfileResult>>>

Returns the profile results for a given tag.

Source

pub fn register_idl(&self, idl: Idl, slot: Option<Slot>) -> SurfpoolResult<()>

Source

pub fn get_idl(&self, address: &Pubkey, slot: Option<Slot>) -> Option<Idl>

Source

pub fn get_forged_account_data( &self, account_pubkey: &Pubkey, account_data: &[u8], idl: &Idl, overrides: &HashMap<String, Value>, ) -> SurfpoolResult<Vec<u8>>

Forges account data by decoding with IDL, applying overrides, and re-encoding.

§Arguments
  • account_pubkey - The public key of the account (used for error messages)
  • account_data - The raw account data bytes
  • idl - The IDL for decoding/encoding the account data
  • overrides - HashMap of field paths (dot notation) to values to override
§Returns

The modified account data bytes with discriminator Forges account data by applying overrides to existing account data

This delegates to the SurfnetSvm implementation.

§Arguments
  • account_pubkey - The account address (for error messages)
  • account_data - The original account data bytes
  • idl - The IDL for the account’s program
  • overrides - Map of field paths to new values
§Returns

The forged account data as bytes, or an error

Source§

impl SurfnetSvmLocker

Program account related functions

Source

pub async fn clone_program_account( &self, remote_ctx: &Option<(SurfnetRemoteClient, CommitmentConfig)>, source_program_id: &Pubkey, destination_program_id: &Pubkey, ) -> SurfpoolContextualizedResult<()>

Clones a program account from source to destination, handling upgradeable loader state.

Source

pub async fn set_program_authority( &self, remote_ctx: &Option<(SurfnetRemoteClient, CommitmentConfig)>, program_id: Pubkey, new_authority: Option<Pubkey>, ) -> SurfpoolContextualizedResult<()>

Source

pub async fn get_program_accounts( &self, remote_ctx: &Option<SurfnetRemoteClient>, program_id: &Pubkey, account_config: RpcAccountInfoConfig, filters: Option<Vec<RpcFilterType>>, ) -> SurfpoolContextualizedResult<Vec<RpcKeyedAccount>>

Source

pub fn get_program_accounts_local( &self, program_id: &Pubkey, account_config: RpcAccountInfoConfig, filters: Option<Vec<RpcFilterType>>, ) -> SurfpoolContextualizedResult<Vec<RpcKeyedAccount>>

Retrieves program accounts from the local SVM cache, returning a contextualized result.

Source

pub fn encode_ui_account( &self, pubkey: &Pubkey, account: &Account, encoding: UiAccountEncoding, additional_data: Option<AccountAdditionalDataV3>, data_slice: Option<UiDataSliceConfig>, ) -> UiAccount

Source

pub async fn get_program_accounts_local_then_remote( &self, client: &SurfnetRemoteClient, program_id: &Pubkey, account_config: RpcAccountInfoConfig, filters: Option<Vec<RpcFilterType>>, ) -> SurfpoolContextualizedResult<Vec<RpcKeyedAccount>>

Retrieves program accounts from the local cache and remote client, combining results.

Source§

impl SurfnetSvmLocker

Source

pub fn get_first_local_slot(&self) -> Option<Slot>

Returns the first local slot (the genesis_slot when this surfnet started). Since empty blocks can be reconstructed on-the-fly, all slots from genesis_slot onwards are valid.

Source

pub async fn get_block( &self, remote_ctx: &Option<SurfnetRemoteClient>, slot: &Slot, config: &RpcBlockConfig, ) -> SurfpoolContextualizedResult<Option<UiConfirmedBlock>>

Source

pub fn get_block_local( &self, slot: &Slot, config: &RpcBlockConfig, ) -> SurfpoolResult<Option<UiConfirmedBlock>>

Source

pub fn get_genesis_hash_local(&self) -> SvmAccessContext<Hash>

Source

pub async fn get_genesis_hash( &self, remote_ctx: &Option<SurfnetRemoteClient>, ) -> SurfpoolContextualizedResult<Hash>

Source§

impl SurfnetSvmLocker

Pass through functions for accessing the underlying SurfnetSvm instance

Source

pub fn simnet_events_tx(&self) -> Sender<SimnetEvent>

Returns a sender for simulation events from the underlying SVM.

Source

pub fn get_epoch_info(&self) -> EpochInfo

Retrieves the latest epoch info from the underlying SVM.

Source

pub fn time_travel( &self, key: Option<(Hash, String)>, simnet_command_tx: Sender<SimnetCommand>, config: TimeTravelConfig, ) -> SurfpoolResult<EpochInfo>

Source

pub fn get_latest_absolute_slot(&self) -> Slot

Retrieves the latest absolute slot from the underlying SVM.

Source

pub fn get_latest_blockhash(&self, config: &CommitmentConfig) -> Option<Hash>

Retrieves the latest blockhash for the given commitment config from the underlying SVM.

Source

pub fn latest_absolute_blockhash(&self) -> Hash

Source

pub fn get_slot_for_commitment(&self, commitment: &CommitmentConfig) -> Slot

Source

pub fn airdrop( &self, pubkey: &Pubkey, lamports: u64, ) -> Result<TransactionResult, AirdropError>

Executes an airdrop via the underlying SVM.

Source

pub fn airdrop_pubkeys(&self, lamports: u64, addresses: &[Pubkey])

Executes a batch airdrop via the underlying SVM.

Source

pub async fn confirm_current_block( &self, remote_ctx: &Option<(SurfnetRemoteClient, CommitmentConfig)>, ) -> SurfpoolResult<()>

Confirms the current block on the underlying SVM, returning Ok(()) or an error.

Source

pub fn subscribe_for_signature_updates( &self, signature: &Signature, subscription_type: SignatureSubscriptionType, ) -> Receiver<(Slot, Option<TransactionError>)>

Subscribes for signature updates (confirmed/finalized) and returns a receiver of events.

Source

pub fn subscribe_for_account_updates( &self, account_pubkey: &Pubkey, encoding: Option<UiAccountEncoding>, ) -> Receiver<UiAccount>

Subscribes for account updates and returns a receiver of account updates.

Source

pub fn subscribe_for_program_updates( &self, program_id: &Pubkey, encoding: Option<UiAccountEncoding>, filters: Option<Vec<RpcFilterType>>, ) -> Receiver<RpcKeyedAccount>

Subscribes for program account updates and returns a receiver of keyed account updates.

Source

pub fn subscribe_for_slot_updates(&self) -> Receiver<SlotInfo>

Subscribes for slot updates and returns a receiver of slot updates.

Source

pub fn subscribe_for_slots_updates(&self) -> Receiver<Arc<SlotUpdate>>

Subscribes for tagged slotsUpdatesSubscribe notifications and returns a receiver of shared SlotUpdate events.

Source

pub fn subscribe_for_logs_updates( &self, commitment_level: &CommitmentLevel, filter: &RpcTransactionLogsFilter, ) -> Receiver<(Slot, RpcLogsResponse)>

Subscribes for logs updates and returns a receiver of logs updates.

Source

pub fn subscribe_for_snapshot_import_updates( &self, snapshot_url: &str, snapshot_id: &str, ) -> Receiver<SnapshotImportNotification>

Subscribes for snapshot import updates and returns a receiver of snapshot import notifications. This method spawns a background task that fetches the snapshot and loads it via load_snapshot.

Source

pub fn runbook_executions(&self) -> Vec<RunbookExecutionStatusReport>

Source

pub fn start_runbook_execution(&self, runbook_id: String)

Source

pub fn complete_runbook_execution( &self, runbook_id: String, error: Option<Vec<String>>, re_enable_ix_profiling: bool, )

Source

pub fn export_snapshot( &self, config: ExportSnapshotConfig, ) -> SurfpoolResult<BTreeMap<String, AccountSnapshot>>

Source

pub fn get_start_time(&self) -> SystemTime

Source§

impl SurfnetSvmLocker

Helpers for writing program accounts

Source

pub async fn write_program( &self, program_id: Pubkey, authority: Option<Pubkey>, offset: usize, data: &[u8], remote_ctx: &Option<(SurfnetRemoteClient, CommitmentConfig)>, ) -> SurfpoolResult<()>

Source

pub async fn get_or_create_program_account( &self, program_id: Pubkey, program_data_address: Pubkey, remote_ctx: &Option<(SurfnetRemoteClient, CommitmentConfig)>, ) -> SurfpoolResult<Account>

Source

pub async fn write_program_data_account_with_offset( &self, program_id: Pubkey, authority: Option<Pubkey>, program_data_address: Pubkey, offset: usize, data: &[u8], remote_ctx: &Option<(SurfnetRemoteClient, CommitmentConfig)>, ) -> SurfpoolResult<Account>

Trait Implementations§

Source§

impl Clone for SurfnetSvmLocker

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> AggregateExpressionMethods for T

Source§

fn aggregate_distinct(self) -> Self::Output
where Self: DistinctDsl,

DISTINCT modifier for aggregate functions Read more
Source§

fn aggregate_all(self) -> Self::Output
where Self: AllDsl,

ALL modifier for aggregate functions Read more
Source§

fn aggregate_filter<P>(self, f: P) -> Self::Output
where P: AsExpression<Bool>, Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,

Add an aggregate function filter Read more
Source§

fn aggregate_order<O>(self, o: O) -> Self::Output
where Self: OrderAggregateDsl<O>,

Add an aggregate function order Read more
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts 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>

Converts 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)

Converts &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)

Converts &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
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> IntoSql for T

Source§

fn into_sql<T>(self) -> Self::Expression

Convert self to an expression for Diesel’s query builder. Read more
Source§

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
where &'a Self: AsExpression<T>, T: SqlType + TypedExpressionType,

Convert &self to an expression for Diesel’s query builder. Read more
Source§

impl<T> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows 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
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows 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
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .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
where Self: BorrowMut<B>, B: ?Sized,

Calls .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
where Self: AsRef<R>, R: ?Sized,

Calls .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
where Self: AsMut<R>, R: ?Sized,

Calls .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
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WindowExpressionMethods for T

Source§

fn over(self) -> Self::Output
where Self: OverDsl,

Turn a function call into a window function call Read more
Source§

fn window_filter<P>(self, f: P) -> Self::Output
where P: AsExpression<Bool>, Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,

Add a filter to the current window function Read more
Source§

fn partition_by<E>(self, expr: E) -> Self::Output
where Self: PartitionByDsl<E>,

Add a partition clause to the current window function Read more
Source§

fn window_order<E>(self, expr: E) -> Self::Output
where Self: OrderWindowDsl<E>,

Add a order clause to the current window function Read more
Source§

fn frame_by<E>(self, expr: E) -> Self::Output
where Self: FrameDsl<E>,

Add a frame clause to the current window function Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more