Skip to main content

ChainStateView

Struct ChainStateView 

Source
pub struct ChainStateView<C>
where C: Clone + Context + 'static,
{
Show 19 fields pub execution_state: ExecutionStateView<C>, pub tip_state: RegisterView<C, ChainTipState>, pub manager: ChainManager<C>, pub pending_validated_blobs: PendingBlobsView<C>, pub pending_proposed_blobs: ReentrantCollectionView<C, AccountOwner, PendingBlobsView<C>>, pub block_hashes: CustomMapView<C, BlockHeight, CryptoHash>, pub received_log: LogView<C, ChainAndHeight>, pub received_certificate_trackers: RegisterView<C, HashMap<ValidatorPublicKey, u64>>, pub inboxes: ReentrantCollectionView<C, ChainId, InboxStateView<C>>, pub outboxes: ReentrantCollectionView<C, ChainId, OutboxStateView<C>>, pub next_expected_events: MapView<C, StreamId, u32>, pub outbox_counters: RegisterView<C, NonCanonicalBTreeMap<BlockHeight, u32>>, pub nonempty_outboxes: RegisterView<C, NonCanonicalBTreeSet<ChainId>>, pub nonempty_inboxes: RegisterView<C, NonCanonicalBTreeSet<ChainId>>, pub block_zero_executed_at: RegisterView<C, Timestamp>, pub next_height_to_preprocess: RegisterView<C, BlockHeight>, pub latest_checkpoint_height: RegisterView<C, Option<BlockHeight>>, pub pre_checkpoint_block_trust: SetView<C, CryptoHash>, pub outbox_index_tracked_hash: RegisterView<C, Option<CryptoHash>>,
}
Expand description

A view accessing the state of a chain.

Fields§

§execution_state: ExecutionStateView<C>

Execution state, including system and user applications.

§tip_state: RegisterView<C, ChainTipState>

Block-chaining state.

§manager: ChainManager<C>

Consensus state.

§pending_validated_blobs: PendingBlobsView<C>

Pending validated block that is still missing blobs. The incomplete set of blobs for the pending validated block.

§pending_proposed_blobs: ReentrantCollectionView<C, AccountOwner, PendingBlobsView<C>>

The incomplete sets of blobs for upcoming proposals.

§block_hashes: CustomMapView<C, BlockHeight, CryptoHash>

Hashes of all known blocks in this chain, indexed by their height. A block at height < next_block_height is executed; a block at height >= next_block_height is preprocessed (verified but not yet executed) and may not be contiguous.

§received_log: LogView<C, ChainAndHeight>

Sender chain and height of all certified blocks known as a receiver (local ordering).

§received_certificate_trackers: RegisterView<C, HashMap<ValidatorPublicKey, u64>>

The number of received_log entries we have synchronized, for each validator.

§inboxes: ReentrantCollectionView<C, ChainId, InboxStateView<C>>

Mailboxes used to receive messages indexed by their origin.

§outboxes: ReentrantCollectionView<C, ChainId, OutboxStateView<C>>

Mailboxes used to send messages, indexed by their target.

§next_expected_events: MapView<C, StreamId, u32>

The indices of next events we expect to see per stream (could be ahead of the last executed block in sparse chains).

§outbox_counters: RegisterView<C, NonCanonicalBTreeMap<BlockHeight, u32>>

Number of outgoing messages in flight for each block height. We use a RegisterView to prioritize speed for small maps.

§nonempty_outboxes: RegisterView<C, NonCanonicalBTreeSet<ChainId>>

Outboxes with at least one pending message. This allows us to avoid loading all outboxes.

§nonempty_inboxes: RegisterView<C, NonCanonicalBTreeSet<ChainId>>

Inboxes with at least one pending added bundle. This allows us to avoid loading all inboxes.

§block_zero_executed_at: RegisterView<C, Timestamp>

The local wall-clock time when block 0 was last executed. Used to prevent reset-on-incorrect-outcome from looping: if not enough time has elapsed since the last reset, the error is returned instead.

§next_height_to_preprocess: RegisterView<C, BlockHeight>

The height at which the next block can be preprocessed: one past the highest height in block_hashes (executed or preprocessed), or next_block_height if block_hashes is empty.

Maintained as an O(1) shortcut for next_height_to_preprocess, since CustomMapView does not yet expose a last_index lookup. Once linera-views gains efficient first/last key support, this field can be removed in favor of block_hashes.last_index().

§latest_checkpoint_height: RegisterView<C, Option<BlockHeight>>

The height of the most recent checkpoint block applied to this chain, if any. Maintained by apply_confirmed_block whenever a block starting with SystemOperation::Checkpoint is executed.

§pre_checkpoint_block_trust: SetView<C, CryptoHash>

Hashes of pre-checkpoint sender blocks the chain has seen a checkpoint cert vouch for via outbox_block_hashes, but whose actual cert bytes are not yet in storage. The worker errors a checkpoint push with MissingPreCheckpointBlocks when this set is non-empty, then accepts each referenced cert (regardless of its own — possibly revoked — epoch) and removes the entry. Once the set is empty, the checkpoint restoration can run end-to-end.

§outbox_index_tracked_hash: RegisterView<C, Option<CryptoHash>>

The hash of the set of fully-tracked chains that nonempty_outboxes and outbox_counters were last reconciled against. On a client these two indices only hold entries for tracked targets; when the tracked set changes this hash stops matching and the indices are reconciled (reconcile_outbox_index). None means they have never been filtered — a pre-existing database entry (migration), or a validator that tracks all chains and never filters.

Implementations§

Source§

impl<C> ChainStateView<C>
where C: Clone + Context + 'static,

Source

pub async fn execution_state( &self, ctx: &Context<'_>, ) -> Result<&ExecutionStateView<C>>

Source

pub async fn tip_state( &self, ctx: &Context<'_>, ) -> Result<&RegisterView<C, ChainTipState>>

Source

pub async fn manager(&self, ctx: &Context<'_>) -> Result<&ChainManager<C>>

Source

pub async fn pending_validated_blobs( &self, ctx: &Context<'_>, ) -> Result<&PendingBlobsView<C>>

Source

pub async fn pending_proposed_blobs( &self, ctx: &Context<'_>, ) -> Result<&ReentrantCollectionView<C, AccountOwner, PendingBlobsView<C>>>

Source

pub async fn block_hashes( &self, ctx: &Context<'_>, ) -> Result<&CustomMapView<C, BlockHeight, CryptoHash>>

Source

pub async fn received_log( &self, ctx: &Context<'_>, ) -> Result<&LogView<C, ChainAndHeight>>

Source

pub async fn received_certificate_trackers( &self, ctx: &Context<'_>, ) -> Result<&RegisterView<C, HashMap<ValidatorPublicKey, u64>>>

Source

pub async fn inboxes( &self, ctx: &Context<'_>, ) -> Result<&ReentrantCollectionView<C, ChainId, InboxStateView<C>>>

Source

pub async fn outboxes( &self, ctx: &Context<'_>, ) -> Result<&ReentrantCollectionView<C, ChainId, OutboxStateView<C>>>

Source

pub async fn next_expected_events( &self, ctx: &Context<'_>, ) -> Result<&MapView<C, StreamId, u32>>

Source

pub async fn outbox_counters( &self, ctx: &Context<'_>, ) -> Result<&RegisterView<C, NonCanonicalBTreeMap<BlockHeight, u32>>>

Source

pub async fn nonempty_outboxes( &self, ctx: &Context<'_>, ) -> Result<&RegisterView<C, NonCanonicalBTreeSet<ChainId>>>

Source

pub async fn nonempty_inboxes( &self, ctx: &Context<'_>, ) -> Result<&RegisterView<C, NonCanonicalBTreeSet<ChainId>>>

Source

pub async fn block_zero_executed_at( &self, ctx: &Context<'_>, ) -> Result<&RegisterView<C, Timestamp>>

Source

pub async fn next_height_to_preprocess( &self, ctx: &Context<'_>, ) -> Result<&RegisterView<C, BlockHeight>>

Source

pub async fn latest_checkpoint_height( &self, ctx: &Context<'_>, ) -> Result<&RegisterView<C, Option<BlockHeight>>>

Source

pub async fn pre_checkpoint_block_trust( &self, ctx: &Context<'_>, ) -> Result<&SetView<C, CryptoHash>>

Source

pub async fn outbox_index_tracked_hash( &self, ctx: &Context<'_>, ) -> Result<&RegisterView<C, Option<CryptoHash>>>

Source§

impl<C> ChainStateView<C>
where C: Context + Clone + 'static, C::Extra: ExecutionRuntimeContext,

Source

pub fn chain_id(&self) -> ChainId

Returns the ChainId of the chain this ChainStateView represents.

Source

pub async fn query_application( &mut self, local_time: Timestamp, query: Query, service_runtime_endpoint: Option<&mut ServiceRuntimeEndpoint>, ) -> Result<QueryOutcome, ChainError>

Source

pub async fn describe_application( &mut self, application_id: ApplicationId, ) -> Result<ApplicationDescription, ChainError>

Source

pub async fn mark_messages_as_received( &mut self, target: &ChainId, height: BlockHeight, tracked: Option<&ChainIdSet>, ) -> Result<bool, ChainError>

Source

pub fn all_messages_delivered_up_to(&self, height: BlockHeight) -> bool

Returns true if there are no more outgoing messages in flight up to the given block height.

Source

pub async fn is_active(&self) -> Result<bool, ChainError>

Invariant for the states of active chains.

Source

pub async fn initialize_if_needed( &mut self, local_time: Timestamp, ) -> Result<(), ChainError>

Initializes the chain if it is not active yet.

Source

pub async fn receive_message_bundle_with_inbox( &mut self, inbox: &mut InboxStateView<C>, origin: &ChainId, bundle: MessageBundle, local_time: Timestamp, add_to_received_log: bool, ) -> Result<(), ChainError>

Attempts to process a new bundle of messages from the given origin. Returns an internal error if the bundle doesn’t appear to be new, based on the sender’s height. The value local_time is specific to each validator and only used for round timeouts.

Returns true if incoming Subscribe messages created new outbox entries.

Source

pub fn update_received_certificate_trackers( &mut self, new_trackers: BTreeMap<ValidatorPublicKey, u64>, )

Updates the received_log trackers.

Source

pub async fn current_committee( &self, ) -> Result<(Epoch, Arc<Committee>), ChainError>

Source

pub async fn ownership(&self) -> Result<&ChainOwnership, ChainError>

Source

pub async fn remove_bundles_from_inboxes( &mut self, timestamp: Timestamp, must_be_present: bool, incoming_bundles: impl IntoIterator<Item = &IncomingBundle>, ) -> Result<(), ChainError>

Removes the incoming message bundles in the block from the inboxes.

If must_be_present is true, an error is returned if any of the bundles have not been added to the inbox yet. So this should be true if the bundles are in a block proposal, and false if the block is already confirmed.

Source

pub fn nonempty_outbox_chain_ids(&self) -> Vec<ChainId>

Returns the chain IDs of all recipients for which a message is waiting in the outbox.

Source

pub async fn load_outboxes( &self, targets: &[ChainId], ) -> Result<Vec<ReadGuardedView<OutboxStateView<C>>>, ChainError>

Returns the outboxes for the given targets, or an error if any of them are missing.

Source

pub async fn reconcile_outbox_index( &mut self, tracked: Option<&Hashed<ChainIdSet>>, ) -> Result<bool, ChainError>

Reconciles the nonempty_outboxes and outbox_counters indices from the retained outbox queues, rebuilding only when the tracked set changed since the last call (i.e. the stored Self::outbox_index_tracked_hash no longer matches). The per-target outbox queues in outboxes are always kept; only these indices are filtered. Returns whether a rebuild actually happened, so a read-only caller can skip persisting when nothing changed.

Source

pub fn outbox_index_is_reconciled( &self, tracked: Option<&Hashed<ChainIdSet>>, ) -> bool

Returns whether the outbox index is already reconciled to tracked (the stored hash matches), so the read-only network-actions path can read it without a write-lock rebuild.

Source

pub async fn execute_block( &mut self, block: ProposedBlock, local_time: Timestamp, round: Option<u32>, published_blobs: &[Blob], replaying_oracle_responses: Option<Vec<Vec<OracleResponse>>>, policy: BundleExecutionPolicy, ) -> Result<(ProposedBlock, BlockExecutionOutcome, ResourceTracker, HashSet<ChainId>), ChainError>

Executes a block with a specified policy for handling bundle failures.

This method supports automatic retry with checkpointing when bundles fail:

  • For limit errors (block too large, fuel exceeded, etc.): the bundle is discarded so it can be retried in a later block, unless it’s the first transaction (which gets rejected as inherently too large).
  • For non-limit errors: the bundle is rejected (triggering bounced messages).
  • After max_failures failed bundles, all remaining message bundles are discarded.

The block may be modified to reflect the actual executed transactions.

Source

pub async fn restore_outboxes_from_unfinalized( &mut self, tracked: Option<&Hashed<ChainIdSet>>, ) -> Result<(), ChainError>

Re-populates outboxes, outbox_counters, and nonempty_outboxes from the on-chain unfinalized_message_blocks map after a checkpoint bootstrap. Called once after execution_state.restore_from_content so the freshly-restored chain can pick up cross-chain delivery for pre-checkpoint messages — the off-chain outbox state isn’t part of the certified checkpoint blob, so without this a bootstrapped node would silently stop pushing pending messages forward.

Source

pub async fn collect_unfinalized_heights( &self, ) -> Result<BTreeSet<BlockHeight>, ChainError>

Returns the sorted, deduplicated set of block heights referenced by the on-chain unfinalized_message_blocks map (one entry per height even if multiple bundles at that height are still unfinalized). Used both when building the checkpoint oracle response (to resolve heights to hashes via block_hashes) and on the bootstrap path (to zip with the certified outbox_block_hashes from the response).

Source

pub async fn apply_confirmed_block( &mut self, block: &ConfirmedBlock, local_time: Timestamp, tracked: Option<&ChainIdSet>, ) -> Result<BTreeSet<StreamId>, ChainError>

Applies an execution outcome to the chain, updating the outboxes, state hash and chain manager. This does not touch the execution state itself, which must be updated separately. Returns the set of event streams that were updated as a result of applying the block.

Source

pub async fn preprocess_block( &mut self, block: &ConfirmedBlock, tracked: Option<&ChainIdSet>, ) -> Result<BTreeSet<StreamId>, ChainError>

Adds a block to block_hashes as preprocessed, and updates the outboxes where possible. Returns the set of streams that were updated as a result of preprocessing the block.

Source

pub async fn block_hashes_for_heights( &self, heights: impl IntoIterator<Item = BlockHeight>, ) -> Result<Vec<CryptoHash>, ChainError>

Returns the hashes of all blocks we have at the given heights, in input order. Unknown heights are skipped.

Trait Implementations§

Source§

impl<C> Allocative for ChainStateView<C>
where C: Clone + Context + 'static,

Source§

fn visit<'allocative_a, 'allocative_b: 'allocative_a>( &self, visitor: &'allocative_a mut Visitor<'allocative_b>, )

Source§

impl<C> ClonableView for ChainStateView<C>

Source§

fn clone_unchecked(&mut self) -> Result<Self, ViewError>

Creates a clone of this view, sharing the underlying storage context but prone to data races which can corrupt the view state.
Source§

impl<C> ContainerType for ChainStateView<C>
where C: Clone + Context + 'static,

Source§

async fn resolve_field(&self, ctx: &Context<'_>) -> ServerResult<Option<Value>>

Resolves a field value and outputs it as a json value async_graphql::Value. Read more
Source§

fn collect_all_fields<'a>( &'a self, ctx: &ContextBase<'a, &'a Positioned<SelectionSet>>, fields: &mut Fields<'a>, ) -> Result<(), ServerError>
where Self: Send + Sync,

Collect all the fields of the container that are queried in the selection set. Read more
Source§

fn find_entity( &self, _: &ContextBase<'_, &Positioned<Field>>, _params: &ConstValue, ) -> impl Future<Output = Result<Option<ConstValue>, ServerError>> + Send

Find the GraphQL entity with the given name from the parameter. Read more
Source§

impl<C> Debug for ChainStateView<C>
where C: Clone + Context + 'static + Debug,

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<C> OutputType for ChainStateView<C>
where C: Clone + Context + 'static,

Source§

fn type_name() -> Cow<'static, str>

Type the name.
Source§

fn create_type_info(registry: &mut Registry) -> String

Create type information in the registry and return qualified typename.
Source§

async fn resolve( &self, ctx: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Resolve an output value to async_graphql::Value.
Source§

fn qualified_type_name() -> String

Qualified typename.
Source§

fn introspection_type_name(&self) -> Cow<'static, str>

Introspection type name Read more
Source§

impl<C> RootView for ChainStateView<C>
where C: Clone + Context + 'static, Self: View,

Source§

async fn save(&mut self) -> Result<(), ViewError>

Saves the root view to the database context
Source§

async fn save_and_drop(self) -> Result<(), ViewError>

Saves the root view to the database context and then drops it without calling post_save.
Source§

impl<C> View for ChainStateView<C>
where C: Context + Clone + Context + 'static, ExecutionStateView<C>: View<Context = C>, RegisterView<C, ChainTipState>: View<Context = C>, ChainManager<C>: View<Context = C>, PendingBlobsView<C>: View<Context = C>, ReentrantCollectionView<C, AccountOwner, PendingBlobsView<C>>: View<Context = C>, CustomMapView<C, BlockHeight, CryptoHash>: View<Context = C>, LogView<C, ChainAndHeight>: View<Context = C>, RegisterView<C, HashMap<ValidatorPublicKey, u64>>: View<Context = C>, ReentrantCollectionView<C, ChainId, InboxStateView<C>>: View<Context = C>, ReentrantCollectionView<C, ChainId, OutboxStateView<C>>: View<Context = C>, MapView<C, StreamId, u32>: View<Context = C>, RegisterView<C, NonCanonicalBTreeMap<BlockHeight, u32>>: View<Context = C>, RegisterView<C, NonCanonicalBTreeSet<ChainId>>: View<Context = C>, RegisterView<C, Timestamp>: View<Context = C>, RegisterView<C, BlockHeight>: View<Context = C>, RegisterView<C, Option<BlockHeight>>: View<Context = C>, SetView<C, CryptoHash>: View<Context = C>, RegisterView<C, Option<CryptoHash>>: View<Context = C>,

Source§

const NUM_INIT_KEYS: usize

The number of keys used for the initialization
Source§

type Context = C

The type of context stored in this view
Source§

fn context(&self) -> C

Obtains a mutable reference to the internal context.
Source§

fn pre_load(context: &C) -> Result<Vec<Vec<u8>>, ViewError>

Creates the keys needed for loading the view
Source§

fn post_load(context: C, values: &[Option<Vec<u8>>]) -> Result<Self, ViewError>

Loads a view from the values
Source§

async fn load(context: C) -> Result<Self, ViewError>

Loads a view
Source§

fn rollback(&mut self)

Discards all pending changes. After that flush should have no effect to storage.
Source§

async fn has_pending_changes(&self) -> bool

Returns true if flushing this view would result in changes to the persistent storage.
Source§

fn pre_save(&self, batch: &mut Batch) -> Result<bool, ViewError>

Computes the batch of operations to persist changes to storage without modifying the view. Crash-resistant storage implementations accumulate the desired changes in the batch variable. The returned boolean indicates whether the operation removes the view or not.
Source§

fn post_save(&mut self)

Updates the view state after the batch has been executed in the database. This should be called after pre_save and after the batch has been successfully written to storage. This leaves the view in a clean state with no pending changes. Read more
Source§

fn clear(&mut self)

Clears the view. That can be seen as resetting to default. If the clear is followed by a flush then all the relevant data is removed on the storage.
Source§

fn new(context: Self::Context) -> Result<Self, ViewError>

Builds a trivial view that is already deleted
Source§

impl<C> ObjectType for ChainStateView<C>
where C: Clone + Context + 'static,

Auto Trait Implementations§

§

impl<C> !Freeze for ChainStateView<C>

§

impl<C> !RefUnwindSafe for ChainStateView<C>

§

impl<C> Send for ChainStateView<C>

§

impl<C> Sync for ChainStateView<C>

§

impl<C> Unpin for ChainStateView<C>
where C: Unpin,

§

impl<C> UnsafeUnpin for ChainStateView<C>
where C: UnsafeUnpin,

§

impl<C> !UnwindSafe for ChainStateView<C>

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

type Output = T

Should always be Self
Source§

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

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

Source§

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> 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<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<_INNER> AutoTraits for _INNER
where _INNER: Send + Sync + 'static,

Source§

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

Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> MaybeSync for T
where T: Sync,

Source§

impl<T> Post for T
where T: Send + 'static,