Struct linera_core::client::ChainClient

source ·
pub struct ChainClient<ValidatorNodeProvider, Storage>
where Storage: Storage,
{ /* private fields */ }
Expand description

Client to operate a chain by interacting with validators and the given local storage implementation.

  • The chain being operated is called the “local chain” or just the “chain”.
  • As a rule, operations are considered successful (and communication may stop) when they succeeded in gathering a quorum of responses.

Implementations§

source§

impl<P: 'static, S: Storage> ChainClient<P, S>

source

pub fn state(&self) -> ChainGuard<'_, ChainClientState>

Gets a shared reference to the chain’s state.

source

pub fn options_mut(&mut self) -> &mut ChainClientOptions

Gets a mutable reference to the per-ChainClient options.

source

pub fn options(&self) -> &ChainClientOptions

Gets a reference to the per-ChainClient options.

source

pub fn chain_id(&self) -> ChainId

Gets the ID of the associated chain.

source

pub fn block_hash(&self) -> Option<CryptoHash>

Gets the hash of the latest known block.

source

pub fn timestamp(&self) -> Timestamp

Gets the earliest possible timestamp for the next block.

source

pub fn next_block_height(&self) -> BlockHeight

Gets the next block height.

source

pub fn pending_proposal(&self) -> ChainGuardMapped<'_, Option<PendingProposal>>

Gets a guarded reference to the next pending block.

source§

impl<P, S> ChainClient<P, S>
where P: ValidatorNodeProvider + Sync + 'static, S: Storage + Clone + Send + Sync + 'static,

source

pub async fn chain_state_view( &self, ) -> Result<OwnedRwLockReadGuard<ChainStateView<S::Context>>, LocalNodeError>

Obtains a ChainStateView for this client’s chain.

source

pub async fn subscribe(&self) -> Result<NotificationStream, LocalNodeError>

Subscribes to notifications from this client’s chain.

source

pub fn storage_client(&self) -> S

Returns the storage client used by this client’s local node.

source

pub async fn chain_info(&self) -> Result<Box<ChainInfo>, LocalNodeError>

Obtains the basic ChainInfo data for the local chain.

source

pub async fn chain_info_with_manager_values( &self, ) -> Result<Box<ChainInfo>, LocalNodeError>

Obtains the basic ChainInfo data for the local chain, with chain manager values.

source

pub async fn epoch_and_committees( &self, chain_id: ChainId, ) -> Result<(Option<Epoch>, BTreeMap<Epoch, Committee>), LocalNodeError>

Obtains the current epoch of the given chain as well as its set of trusted committees.

source

pub async fn epochs(&self) -> Result<Vec<Epoch>, LocalNodeError>

Obtains the epochs of the committees trusted by the local chain.

source

pub async fn local_committee(&self) -> Result<Committee, LocalNodeError>

Obtains the committee for the current epoch of the local chain.

source

pub async fn identity(&self) -> Result<Owner, ChainClientError>

Obtains the identity of the current owner of the chain. Returns an error if we have the private key for more than one identity.

source

pub async fn key_pair(&self) -> Result<AccountSecretKey, ChainClientError>

Obtains the key pair associated to the current identity.

source

pub async fn public_key(&self) -> Result<AccountPublicKey, ChainClientError>

Obtains the public key associated to the current identity.

source

pub async fn prepare_chain(&self) -> Result<Box<ChainInfo>, ChainClientError>

Prepares the chain for the next operation, i.e. makes sure we have synchronized it up to its current height and are not missing any received messages from the inbox.

source

pub async fn synchronize_until( &self, next_block_height: BlockHeight, ) -> Result<Box<ChainInfo>, ChainClientError>

source

pub async fn submit_block_proposal<T: ProcessableCertificate>( &self, committee: &Committee, proposal: Box<BlockProposal>, value: Hashed<T>, ) -> Result<GenericCertificate<T>, ChainClientError>

Submits a block proposal to the validators.

source

pub async fn update_validators( &self, old_committee: Option<&Committee>, ) -> Result<(), ChainClientError>

Attempts to update all validators about the local chain.

source

pub async fn communicate_chain_updates( &self, committee: &Committee, chain_id: ChainId, height: BlockHeight, delivery: CrossChainMessageDelivery, ) -> Result<(), ChainClientError>

Broadcasts certified blocks to validators.

source

pub async fn transfer( &self, owner: Option<Owner>, amount: Amount, recipient: Recipient, ) -> Result<ClientOutcome<ConfirmedBlockCertificate>, ChainClientError>

Sends money.

source

pub async fn read_data_blob( &self, hash: CryptoHash, ) -> Result<ClientOutcome<ConfirmedBlockCertificate>, ChainClientError>

Verify if a data blob is readable from storage.

source

pub async fn claim( &self, owner: Owner, target_id: ChainId, recipient: Recipient, amount: Amount, ) -> Result<ClientOutcome<ConfirmedBlockCertificate>, ChainClientError>

Claims money in a remote chain.

source

pub async fn process_certificate<T: ProcessableCertificate>( &self, certificate: GenericCertificate<T>, ) -> Result<(), LocalNodeError>

Handles the certificate in the local node and the resulting notifications.

source

pub async fn request_leader_timeout( &self, ) -> Result<TimeoutCertificate, ChainClientError>

Requests a leader timeout vote from all validators. If a quorum signs it, creates a certificate and sends it to all validators, to make them enter the next round.

source

pub async fn receive_certificate_for_blob( &self, blob_id: BlobId, ) -> Result<(), ChainClientError>

Downloads and processes a confirmed block certificate that uses the given blob. If this succeeds, the blob will be in our storage.

source

pub async fn receive_certificates_for_blobs( &self, blob_ids: Vec<BlobId>, ) -> Result<(), ChainClientError>

Downloads and processes confirmed block certificates that use the given blobs. If this succeeds, the blobs will be in our storage.

source

pub async fn execute_operations( &self, operations: Vec<Operation>, blobs: Vec<Blob>, ) -> Result<ClientOutcome<ConfirmedBlockCertificate>, ChainClientError>

Executes a list of operations.

source

pub async fn execute_operation( &self, operation: Operation, ) -> Result<ClientOutcome<ConfirmedBlockCertificate>, ChainClientError>

Executes an operation.

source

pub async fn query_application( &self, query: Query, ) -> Result<QueryOutcome, ChainClientError>

Queries an application.

source

pub async fn query_system_application( &self, query: SystemQuery, ) -> Result<QueryOutcome<SystemResponse>, ChainClientError>

Queries a system application.

source

pub async fn query_user_application<A: Abi>( &self, application_id: UserApplicationId<A>, query: &A::Query, ) -> Result<QueryOutcome<A::QueryResponse>, ChainClientError>

Queries a user application.

source

pub async fn query_balance(&self) -> Result<Amount, ChainClientError>

Obtains the local balance of the chain account after staging the execution of incoming messages in a new block.

Does not attempt to synchronize with validators. The result will reflect up to max_pending_message_bundles incoming message bundles and the execution fees for a single block.

source

pub async fn query_owner_balance( &self, owner: AccountOwner, ) -> Result<Amount, ChainClientError>

Obtains the local balance of an account after staging the execution of incoming messages in a new block.

Does not attempt to synchronize with validators. The result will reflect up to max_pending_message_bundles incoming message bundles and the execution fees for a single block.

source

pub async fn local_balance(&self) -> Result<Amount, ChainClientError>

Reads the local balance of the chain account.

Does not process the inbox or attempt to synchronize with validators.

source

pub async fn local_owner_balance( &self, owner: AccountOwner, ) -> Result<Amount, ChainClientError>

Reads the local balance of a user account.

Does not process the inbox or attempt to synchronize with validators.

source

pub async fn request_application( &self, application_id: UserApplicationId, chain_id: Option<ChainId>, ) -> Result<ClientOutcome<ConfirmedBlockCertificate>, ChainClientError>

Requests a RegisterApplications message from another chain so the application can be used on this one.

source

pub async fn transfer_to_account( &self, owner: Option<Owner>, amount: Amount, account: Account, ) -> Result<ClientOutcome<ConfirmedBlockCertificate>, ChainClientError>

Sends tokens to a chain.

source

pub async fn burn( &self, owner: Option<Owner>, amount: Amount, ) -> Result<ClientOutcome<ConfirmedBlockCertificate>, ChainClientError>

Burns tokens.

source

pub async fn synchronize_from_validators( &self, ) -> Result<Box<ChainInfo>, ChainClientError>

Attempts to synchronize chains that have sent us messages and populate our local inbox.

To create a block that actually executes the messages in the inbox, process_inbox must be called separately.

source

pub async fn process_pending_block( &self, ) -> Result<ClientOutcome<Option<ConfirmedBlockCertificate>>, ChainClientError>

Processes the last pending block

source

pub fn clear_pending_proposal(&self)

Clears the information on any operation that previously failed.

source

pub async fn receive_certificate_and_update_validators( &self, certificate: ConfirmedBlockCertificate, ) -> Result<(), ChainClientError>

Processes a confirmed block for which this chain is a recipient and updates validators.

source

pub async fn receive_certificate( &self, certificate: ConfirmedBlockCertificate, ) -> Result<(), ChainClientError>

Processes confirmed operation for which this chain is a recipient.

source

pub async fn rotate_key_pair( &self, key_pair: AccountSecretKey, ) -> Result<ClientOutcome<ConfirmedBlockCertificate>, ChainClientError>

Rotates the key of the chain.

source

pub async fn transfer_ownership( &self, new_owner: Owner, ) -> Result<ClientOutcome<ConfirmedBlockCertificate>, ChainClientError>

Transfers ownership of the chain to a single super owner.

source

pub async fn share_ownership( &self, new_owner: Owner, new_weight: u64, ) -> Result<ClientOutcome<ConfirmedBlockCertificate>, ChainClientError>

Adds another owner to the chain, and turns existing super owners into regular owners.

source

pub async fn change_ownership( &self, ownership: ChainOwnership, ) -> Result<ClientOutcome<ConfirmedBlockCertificate>, ChainClientError>

Changes the ownership of this chain. Fails if it would remove existing owners, unless remove_owners is true.

source

pub async fn change_application_permissions( &self, application_permissions: ApplicationPermissions, ) -> Result<ClientOutcome<ConfirmedBlockCertificate>, ChainClientError>

Changes the application permissions configuration on this chain.

source

pub async fn open_chain( &self, ownership: ChainOwnership, application_permissions: ApplicationPermissions, balance: Amount, ) -> Result<ClientOutcome<(MessageId, ConfirmedBlockCertificate)>, ChainClientError>

Opens a new chain with a derived UID.

source

pub async fn close_chain( &self, ) -> Result<ClientOutcome<Option<ConfirmedBlockCertificate>>, ChainClientError>

Closes the chain (and loses everything in it!!). Returns None if the chain was already closed.

source

pub async fn publish_bytecode( &self, contract: Bytecode, service: Bytecode, vm_runtime: VmRuntime, ) -> Result<ClientOutcome<(BytecodeId, ConfirmedBlockCertificate)>, ChainClientError>

Publishes some bytecode.

source

pub async fn publish_bytecode_blobs( &self, contract_blob: Blob, service_blob: Blob, bytecode_id: BytecodeId, ) -> Result<ClientOutcome<(BytecodeId, ConfirmedBlockCertificate)>, ChainClientError>

Publishes some bytecode.

source

pub async fn publish_data_blobs( &self, bytes: Vec<Vec<u8>>, ) -> Result<ClientOutcome<ConfirmedBlockCertificate>, ChainClientError>

Publishes some data blobs.

source

pub async fn publish_data_blob( &self, bytes: Vec<u8>, ) -> Result<ClientOutcome<ConfirmedBlockCertificate>, ChainClientError>

Publishes some data blob.

source

pub async fn create_application<A: Abi, Parameters: Serialize, InstantiationArgument: Serialize>( &self, bytecode_id: BytecodeId<A, Parameters, InstantiationArgument>, parameters: &Parameters, instantiation_argument: &InstantiationArgument, required_application_ids: Vec<UserApplicationId>, ) -> Result<ClientOutcome<(UserApplicationId<A>, ConfirmedBlockCertificate)>, ChainClientError>

Creates an application by instantiating some bytecode.

source

pub async fn create_application_untyped( &self, bytecode_id: BytecodeId, parameters: Vec<u8>, instantiation_argument: Vec<u8>, required_application_ids: Vec<UserApplicationId>, ) -> Result<ClientOutcome<(UserApplicationId, ConfirmedBlockCertificate)>, ChainClientError>

Creates an application by instantiating some bytecode.

source

pub async fn stage_new_committee( &self, committee: Committee, ) -> Result<ClientOutcome<ConfirmedBlockCertificate>, ChainClientError>

Creates a new committee and starts using it (admin chains only).

source

pub async fn process_inbox( &self, ) -> Result<(Vec<ConfirmedBlockCertificate>, Option<RoundTimeout>), ChainClientError>

Synchronizes the chain with the validators and creates blocks without any operations to process all incoming messages. This may require several blocks.

If not all certificates could be processed due to a timeout, the timestamp for when to retry is returned, too.

source

pub async fn process_inbox_without_prepare( &self, ) -> Result<(Vec<ConfirmedBlockCertificate>, Option<RoundTimeout>), ChainClientError>

Creates blocks without any operations to process all incoming messages. This may require several blocks.

If not all certificates could be processed due to a timeout, the timestamp for when to retry is returned, too.

source

pub async fn subscribe_to_new_committees( &self, ) -> Result<ClientOutcome<ConfirmedBlockCertificate>, ChainClientError>

Starts listening to the admin chain for new committees. (This is only useful for other genesis chains or for testing.)

source

pub async fn unsubscribe_from_new_committees( &self, ) -> Result<ClientOutcome<ConfirmedBlockCertificate>, ChainClientError>

Stops listening to the admin chain for new committees. (This is only useful for testing.)

source

pub async fn finalize_committee( &self, ) -> Result<ClientOutcome<ConfirmedBlockCertificate>, ChainClientError>

Deprecates all the configurations of voting rights but the last one (admin chains only). Currently, each individual chain is still entitled to wait before accepting this command. However, it is expected that deprecated validators stop functioning shortly after such command is issued.

source

pub async fn transfer_to_account_unsafe_unconfirmed( &self, owner: Option<Owner>, amount: Amount, account: Account, ) -> Result<ClientOutcome<ConfirmedBlockCertificate>, ChainClientError>

Sends money to a chain. Do not check balance. (This may block the client) Do not confirm the transaction.

source

pub async fn read_hashed_confirmed_block( &self, hash: CryptoHash, ) -> Result<Hashed<ConfirmedBlock>, ViewError>

source

pub async fn retry_pending_outgoing_messages( &self, ) -> Result<(), ChainClientError>

Handles any cross-chain requests for any pending outgoing messages.

source

pub async fn read_hashed_confirmed_blocks_downward( &self, from: CryptoHash, limit: u32, ) -> Result<Vec<Hashed<ConfirmedBlock>>, ViewError>

source

pub async fn listen( &self, ) -> Result<(impl Future<Output = ()>, AbortOnDrop, NotificationStream), ChainClientError>

Spawns a task that listens to notifications about the current chain from all validators, and synchronizes the local state accordingly.

source

pub async fn sync_validator( &self, remote_node: P::Node, ) -> Result<(), ChainClientError>

Attempts to update a validator with the local information.

Trait Implementations§

source§

impl<P, S> Clone for ChainClient<P, S>
where S: Storage,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<ValidatorNodeProvider, Storage> Debug for ChainClient<ValidatorNodeProvider, Storage>
where Storage: Storage,

source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<ValidatorNodeProvider, Storage> Freeze for ChainClient<ValidatorNodeProvider, Storage>

§

impl<ValidatorNodeProvider, Storage> !RefUnwindSafe for ChainClient<ValidatorNodeProvider, Storage>

§

impl<ValidatorNodeProvider, Storage> Send for ChainClient<ValidatorNodeProvider, Storage>
where ValidatorNodeProvider: Sync + Send, Storage: Sync + Send,

§

impl<ValidatorNodeProvider, Storage> Sync for ChainClient<ValidatorNodeProvider, Storage>
where ValidatorNodeProvider: Sync + Send, Storage: Sync + Send,

§

impl<ValidatorNodeProvider, Storage> Unpin for ChainClient<ValidatorNodeProvider, Storage>

§

impl<ValidatorNodeProvider, Storage> !UnwindSafe for ChainClient<ValidatorNodeProvider, Storage>

Blanket Implementations§

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<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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<Choices> CoproductSubsetter<CNil, HNil> for Choices

§

type Remainder = Choices

source§

fn subset( self, ) -> Result<CNil, <Choices as CoproductSubsetter<CNil, HNil>>::Remainder>

Extract a subset of the possible types in a coproduct (or get the remaining possibilities) Read more
source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

source§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
source§

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

source§

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

source§

impl<To, From> DynInto<To> for From
where From: Into<To>,

source§

fn into_box(self: Box<From>) -> To

Converts a boxed object into the target type.
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> FromRef<T> for T
where T: Clone,

source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
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> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
source§

impl<T> LayoutRaw for T

source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
source§

impl<T, U, I> LiftInto<U, I> for T
where U: LiftFrom<T, I>,

source§

fn lift_into(self) -> U

Performs the indexed conversion.
source§

impl<T> MockResults for T

§

type Results = T

The mock native type of the results for the MockInstance.
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.
§

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> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
source§

impl<M, I> RuntimeMemory<&mut I> for M
where M: RuntimeMemory<I>,

source§

fn read<'instance>( &self, instance: &'instance &mut I, location: GuestPointer, length: u32, ) -> Result<Cow<'instance, [u8]>, RuntimeError>

Reads length bytes from memory from the provided location.

source§

fn write( &mut self, instance: &mut &mut I, location: GuestPointer, bytes: &[u8], ) -> Result<(), RuntimeError>

Writes the bytes to memory at the provided location.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<Source> Sculptor<HNil, HNil> for Source

§

type Remainder = Source

source§

fn sculpt(self) -> (HNil, <Source as Sculptor<HNil, HNil>>::Remainder)

Consumes the current HList and returns an HList with the requested shape. Read more
source§

impl<AnyTail> Split<HNil> for AnyTail

§

type Remainder = AnyTail

The tail of remaining elements after splitting up the list.
source§

fn split(self) -> (HNil, <AnyTail as Split<HNil>>::Remainder)

Splits the current heterogeneous list in two.
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,

§

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

§

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

§

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<T> Upcastable for T
where T: Any + Send + Sync + 'static,

source§

fn upcast_any_ref(&self) -> &(dyn Any + 'static)

upcast ref
source§

fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)

upcast mut ref
source§

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

upcast boxed dyn
source§

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

source§

fn vzip(self) -> V

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
source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T

source§

impl<T> Post for T
where T: Send + Sync,