pub struct ChainManager<C>{Show 17 fields
pub ownership: RegisterView<C, ChainOwnership>,
pub seed: RegisterView<C, u64>,
pub distribution: RegisterView<C, Option<WeightedAliasIndex<u64>>>,
pub fallback_distribution: RegisterView<C, Option<WeightedAliasIndex<u64>>>,
pub signed_proposal: RegisterView<C, Option<BlockProposal>>,
pub proposed: RegisterView<C, Option<BlockProposal>>,
pub proposed_blobs: MapView<C, BlobId, Blob>,
pub locking_block: RegisterView<C, Option<LockingBlock>>,
pub locking_blobs: MapView<C, BlobId, Blob>,
pub timeout: RegisterView<C, Option<TimeoutCertificate>>,
pub confirmed_vote: RegisterView<C, Option<Vote<ConfirmedBlock>>>,
pub validated_vote: RegisterView<C, Option<Vote<ValidatedBlock>>>,
pub timeout_vote: RegisterView<C, Option<Vote<Timeout>>>,
pub fallback_vote: RegisterView<C, Option<Vote<Timeout>>>,
pub round_timeout: RegisterView<C, Option<Timestamp>>,
pub current_round: RegisterView<C, Round>,
pub fallback_owners: RegisterView<C, BTreeMap<AccountOwner, u64>>,
}Expand description
The state of the certification process for a chain’s next block.
Fields§
§ownership: RegisterView<C, ChainOwnership>The public keys, weights and types of the chain’s owners.
seed: RegisterView<C, u64>The seed for the pseudo-random number generator that determines the round leaders.
distribution: RegisterView<C, Option<WeightedAliasIndex<u64>>>The probability distribution for choosing a round leader.
fallback_distribution: RegisterView<C, Option<WeightedAliasIndex<u64>>>The probability distribution for choosing a fallback round leader.
signed_proposal: RegisterView<C, Option<BlockProposal>>Highest-round authenticated block that we have received, but not necessarily checked yet. If there are multiple proposals in the same round, this contains only the first one. This can even contain proposals that did not execute successfully, to determine which round to propose in.
proposed: RegisterView<C, Option<BlockProposal>>Highest-round authenticated block that we have received and checked. If there are multiple proposals in the same round, this contains only the first one.
proposed_blobs: MapView<C, BlobId, Blob>These are blobs published or read by the proposed block.
locking_block: RegisterView<C, Option<LockingBlock>>Latest validated proposal that a validator may have voted to confirm. This is either the
latest ValidatedBlock we have seen, or the proposal from the Fast round.
locking_blobs: MapView<C, BlobId, Blob>These are blobs published or read by the locking block.
timeout: RegisterView<C, Option<TimeoutCertificate>>Latest leader timeout certificate we have received.
confirmed_vote: RegisterView<C, Option<Vote<ConfirmedBlock>>>Latest vote we cast to confirm a block.
validated_vote: RegisterView<C, Option<Vote<ValidatedBlock>>>Latest vote we cast to validate a block.
timeout_vote: RegisterView<C, Option<Vote<Timeout>>>Latest timeout vote we cast.
fallback_vote: RegisterView<C, Option<Vote<Timeout>>>Fallback vote we cast.
round_timeout: RegisterView<C, Option<Timestamp>>The time after which we are ready to sign a timeout certificate for the current round.
current_round: RegisterView<C, Round>The lowest round where we can still vote to validate or confirm a block. This is the round to which the timeout applies.
Having a leader timeout certificate in any given round causes the next one to become current. Seeing a validated block certificate or a valid proposal in any round causes that round to become current, unless a higher one already is.
fallback_owners: RegisterView<C, BTreeMap<AccountOwner, u64>>The owners that take over in fallback mode.
Implementations§
Source§impl<C> ChainManager<C>
impl<C> ChainManager<C>
pub async fn ownership( &self, ctx: &Context<'_>, ) -> Result<&RegisterView<C, ChainOwnership>>
pub async fn seed(&self, ctx: &Context<'_>) -> Result<&RegisterView<C, u64>>
pub async fn proposed_blobs( &self, ctx: &Context<'_>, ) -> Result<&MapView<C, BlobId, Blob>>
pub async fn locking_blobs( &self, ctx: &Context<'_>, ) -> Result<&MapView<C, BlobId, Blob>>
pub async fn round_timeout( &self, ctx: &Context<'_>, ) -> Result<&RegisterView<C, Option<Timestamp>>>
pub async fn fallback_owners( &self, ctx: &Context<'_>, ) -> Result<&RegisterView<C, BTreeMap<AccountOwner, u64>>>
Source§impl<C> ChainManager<C>
impl<C> ChainManager<C>
Sourcepub fn reset<'a>(
&mut self,
ownership: ChainOwnership,
height: BlockHeight,
local_time: Timestamp,
fallback_owners: impl Iterator<Item = (AccountPublicKey, u64)> + 'a,
) -> Result<(), ChainError>
pub fn reset<'a>( &mut self, ownership: ChainOwnership, height: BlockHeight, local_time: Timestamp, fallback_owners: impl Iterator<Item = (AccountPublicKey, u64)> + 'a, ) -> Result<(), ChainError>
Replaces self with a new chain manager.
Sourcepub fn confirmed_vote(&self) -> Option<&Vote<ConfirmedBlock>>
pub fn confirmed_vote(&self) -> Option<&Vote<ConfirmedBlock>>
Returns the most recent confirmed vote we cast.
Sourcepub fn validated_vote(&self) -> Option<&Vote<ValidatedBlock>>
pub fn validated_vote(&self) -> Option<&Vote<ValidatedBlock>>
Returns the most recent validated vote we cast.
Sourcepub fn timeout_vote(&self) -> Option<&Vote<Timeout>>
pub fn timeout_vote(&self) -> Option<&Vote<Timeout>>
Returns the most recent timeout vote we cast.
Sourcepub fn fallback_vote(&self) -> Option<&Vote<Timeout>>
pub fn fallback_vote(&self) -> Option<&Vote<Timeout>>
Returns the most recent fallback vote we cast.
Sourcepub fn current_round(&self) -> Round
pub fn current_round(&self) -> Round
Returns the lowest round where we can still vote to validate or confirm a block. This is the round to which the timeout applies.
Having a leader timeout certificate in any given round causes the next one to become current. Seeing a validated block certificate or a valid proposal in any round causes that round to become current, unless a higher one already is.
Sourcepub fn check_proposed_block(
&self,
proposal: &BlockProposal,
) -> Result<Outcome, ChainError>
pub fn check_proposed_block( &self, proposal: &BlockProposal, ) -> Result<Outcome, ChainError>
Verifies that a proposed block is relevant and should be handled.
Sourcepub fn create_timeout_vote(
&mut self,
chain_id: ChainId,
height: BlockHeight,
round: Round,
epoch: Epoch,
key_pair: Option<&ValidatorSecretKey>,
local_time: Timestamp,
) -> Result<bool, ChainError>
pub fn create_timeout_vote( &mut self, chain_id: ChainId, height: BlockHeight, round: Round, epoch: Epoch, key_pair: Option<&ValidatorSecretKey>, local_time: Timestamp, ) -> Result<bool, ChainError>
Checks if the current round has timed out, and signs a Timeout. Returns true if the
chain manager’s state has changed.
Sourcepub fn vote_fallback(
&mut self,
chain_id: ChainId,
height: BlockHeight,
epoch: Epoch,
key_pair: Option<&ValidatorSecretKey>,
) -> bool
pub fn vote_fallback( &mut self, chain_id: ChainId, height: BlockHeight, epoch: Epoch, key_pair: Option<&ValidatorSecretKey>, ) -> bool
Signs a Timeout certificate to switch to fallback mode.
This must only be called after verifying that the condition for fallback mode is satisfied locally.
Sourcepub fn check_validated_block(
&self,
certificate: &ValidatedBlockCertificate,
) -> Result<Outcome, ChainError>
pub fn check_validated_block( &self, certificate: &ValidatedBlockCertificate, ) -> Result<Outcome, ChainError>
Verifies that a validated block is still relevant and should be handled.
Sourcepub fn create_vote(
&mut self,
proposal: BlockProposal,
block: Block,
key_pair: Option<&ValidatorSecretKey>,
local_time: Timestamp,
blobs: BTreeMap<BlobId, Blob>,
) -> Result<Option<ValidatedOrConfirmedVote<'_>>, ChainError>
pub fn create_vote( &mut self, proposal: BlockProposal, block: Block, key_pair: Option<&ValidatorSecretKey>, local_time: Timestamp, blobs: BTreeMap<BlobId, Blob>, ) -> Result<Option<ValidatedOrConfirmedVote<'_>>, ChainError>
Signs a vote to validate the proposed block.
Sourcepub fn create_final_vote(
&mut self,
validated: ValidatedBlockCertificate,
key_pair: Option<&ValidatorSecretKey>,
local_time: Timestamp,
blobs: BTreeMap<BlobId, Blob>,
) -> Result<(), ViewError>
pub fn create_final_vote( &mut self, validated: ValidatedBlockCertificate, key_pair: Option<&ValidatorSecretKey>, local_time: Timestamp, blobs: BTreeMap<BlobId, Blob>, ) -> Result<(), ViewError>
Signs a vote to confirm the validated block.
Sourcepub async fn pending_blob(
&self,
blob_id: &BlobId,
) -> Result<Option<Blob>, ViewError>
pub async fn pending_blob( &self, blob_id: &BlobId, ) -> Result<Option<Blob>, ViewError>
Returns the requested blob if it belongs to the proposal or the locking block.
Sourcepub async fn pending_blobs(
&self,
blob_ids: &[BlobId],
) -> Result<Vec<Option<Blob>>, ViewError>
pub async fn pending_blobs( &self, blob_ids: &[BlobId], ) -> Result<Vec<Option<Blob>>, ViewError>
Returns the requested blobs if they belong to the proposal or the locking block.
Sourcepub fn handle_timeout_certificate(
&mut self,
certificate: TimeoutCertificate,
local_time: Timestamp,
)
pub fn handle_timeout_certificate( &mut self, certificate: TimeoutCertificate, local_time: Timestamp, )
Updates the round number and timer if the timeout certificate is from a higher round than any known certificate.
Sourcepub fn can_propose(&self, owner: &AccountOwner, round: Round) -> bool
pub fn can_propose(&self, owner: &AccountOwner, round: Round) -> bool
Returns whether the signer is a valid owner and allowed to propose a block in the proposal’s round.
Super owners can always propose, except in Validator rounds, but it is recommended that
they don’t interfere with single-leader rounds. In multi-leader rounds, any owner can
propose (or anyone, if open_multi_leader_rounds) and in other rounds there is only
one leader.
Sourcepub fn update_signed_proposal(
&mut self,
proposal: &BlockProposal,
local_time: Timestamp,
) -> bool
pub fn update_signed_proposal( &mut self, proposal: &BlockProposal, local_time: Timestamp, ) -> bool
Sets the signed proposal, if it is newer than the known one, at most from the first single-leader round. Returns whether it was updated.
We don’t update the signed proposal for any rounds later than SingleLeader(0),
because single-leader rounds cannot be skipped without a timeout certificate.
Trait Implementations§
Source§impl<C> Allocative for ChainManager<C>
impl<C> Allocative for ChainManager<C>
Source§impl<C> ClonableView for ChainManager<C>where
C: Clone + Context + 'static,
RegisterView<C, ChainOwnership>: ClonableView,
RegisterView<C, u64>: ClonableView,
RegisterView<C, Option<WeightedAliasIndex<u64>>>: ClonableView,
RegisterView<C, Option<BlockProposal>>: ClonableView,
MapView<C, BlobId, Blob>: ClonableView,
RegisterView<C, Option<LockingBlock>>: ClonableView,
RegisterView<C, Option<TimeoutCertificate>>: ClonableView,
RegisterView<C, Option<Vote<ConfirmedBlock>>>: ClonableView,
RegisterView<C, Option<Vote<ValidatedBlock>>>: ClonableView,
RegisterView<C, Option<Vote<Timeout>>>: ClonableView,
RegisterView<C, Option<Timestamp>>: ClonableView,
RegisterView<C, Round>: ClonableView,
RegisterView<C, BTreeMap<AccountOwner, u64>>: ClonableView,
Self: View,
impl<C> ClonableView for ChainManager<C>where
C: Clone + Context + 'static,
RegisterView<C, ChainOwnership>: ClonableView,
RegisterView<C, u64>: ClonableView,
RegisterView<C, Option<WeightedAliasIndex<u64>>>: ClonableView,
RegisterView<C, Option<BlockProposal>>: ClonableView,
MapView<C, BlobId, Blob>: ClonableView,
RegisterView<C, Option<LockingBlock>>: ClonableView,
RegisterView<C, Option<TimeoutCertificate>>: ClonableView,
RegisterView<C, Option<Vote<ConfirmedBlock>>>: ClonableView,
RegisterView<C, Option<Vote<ValidatedBlock>>>: ClonableView,
RegisterView<C, Option<Vote<Timeout>>>: ClonableView,
RegisterView<C, Option<Timestamp>>: ClonableView,
RegisterView<C, Round>: ClonableView,
RegisterView<C, BTreeMap<AccountOwner, u64>>: ClonableView,
Self: View,
Source§fn clone_unchecked(&mut self) -> Result<Self, ViewError>
fn clone_unchecked(&mut self) -> Result<Self, ViewError>
Source§impl<C> ContainerType for ChainManager<C>
impl<C> ContainerType for ChainManager<C>
Source§async fn resolve_field(&self, ctx: &Context<'_>) -> ServerResult<Option<Value>>
async fn resolve_field(&self, ctx: &Context<'_>) -> ServerResult<Option<Value>>
async_graphql::Value. Read moreSource§fn collect_all_fields<'a>(
&'a self,
ctx: &ContextBase<'a, &'a Positioned<SelectionSet>>,
fields: &mut Fields<'a>,
) -> Result<(), ServerError>
fn collect_all_fields<'a>( &'a self, ctx: &ContextBase<'a, &'a Positioned<SelectionSet>>, fields: &mut Fields<'a>, ) -> Result<(), ServerError>
Source§fn find_entity(
&self,
_: &ContextBase<'_, &Positioned<Field>>,
_params: &ConstValue,
) -> impl Future<Output = Result<Option<ConstValue>, ServerError>> + Send
fn find_entity( &self, _: &ContextBase<'_, &Positioned<Field>>, _params: &ConstValue, ) -> impl Future<Output = Result<Option<ConstValue>, ServerError>> + Send
Source§impl<C> Debug for ChainManager<C>where
C: Clone + Context + 'static,
RegisterView<C, ChainOwnership>: Debug,
RegisterView<C, u64>: Debug,
RegisterView<C, Option<WeightedAliasIndex<u64>>>: Debug,
RegisterView<C, Option<BlockProposal>>: Debug,
MapView<C, BlobId, Blob>: Debug,
RegisterView<C, Option<LockingBlock>>: Debug,
RegisterView<C, Option<TimeoutCertificate>>: Debug,
RegisterView<C, Option<Vote<ConfirmedBlock>>>: Debug,
RegisterView<C, Option<Vote<ValidatedBlock>>>: Debug,
RegisterView<C, Option<Vote<Timeout>>>: Debug,
RegisterView<C, Option<Timestamp>>: Debug,
RegisterView<C, Round>: Debug,
RegisterView<C, BTreeMap<AccountOwner, u64>>: Debug,
impl<C> Debug for ChainManager<C>where
C: Clone + Context + 'static,
RegisterView<C, ChainOwnership>: Debug,
RegisterView<C, u64>: Debug,
RegisterView<C, Option<WeightedAliasIndex<u64>>>: Debug,
RegisterView<C, Option<BlockProposal>>: Debug,
MapView<C, BlobId, Blob>: Debug,
RegisterView<C, Option<LockingBlock>>: Debug,
RegisterView<C, Option<TimeoutCertificate>>: Debug,
RegisterView<C, Option<Vote<ConfirmedBlock>>>: Debug,
RegisterView<C, Option<Vote<ValidatedBlock>>>: Debug,
RegisterView<C, Option<Vote<Timeout>>>: Debug,
RegisterView<C, Option<Timestamp>>: Debug,
RegisterView<C, Round>: Debug,
RegisterView<C, BTreeMap<AccountOwner, u64>>: Debug,
Source§impl<C> From<&ChainManager<C>> for ChainManagerInfo
impl<C> From<&ChainManager<C>> for ChainManagerInfo
Source§fn from(manager: &ChainManager<C>) -> Self
fn from(manager: &ChainManager<C>) -> Self
Source§impl<C> OutputType for ChainManager<C>
impl<C> OutputType for ChainManager<C>
Source§fn create_type_info(registry: &mut Registry) -> String
fn create_type_info(registry: &mut Registry) -> String
Source§async fn resolve(
&self,
ctx: &ContextSelectionSet<'_>,
_field: &Positioned<Field>,
) -> ServerResult<Value>
async fn resolve( &self, ctx: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>
async_graphql::Value.Source§fn qualified_type_name() -> String
fn qualified_type_name() -> String
Source§impl<C> View for ChainManager<C>where
C: Context + Clone + Context + 'static,
RegisterView<C, ChainOwnership>: View<Context = C>,
RegisterView<C, u64>: View<Context = C>,
RegisterView<C, Option<WeightedAliasIndex<u64>>>: View<Context = C>,
RegisterView<C, Option<BlockProposal>>: View<Context = C>,
MapView<C, BlobId, Blob>: View<Context = C>,
RegisterView<C, Option<LockingBlock>>: View<Context = C>,
RegisterView<C, Option<TimeoutCertificate>>: View<Context = C>,
RegisterView<C, Option<Vote<ConfirmedBlock>>>: View<Context = C>,
RegisterView<C, Option<Vote<ValidatedBlock>>>: View<Context = C>,
RegisterView<C, Option<Vote<Timeout>>>: View<Context = C>,
RegisterView<C, Option<Timestamp>>: View<Context = C>,
RegisterView<C, Round>: View<Context = C>,
RegisterView<C, BTreeMap<AccountOwner, u64>>: View<Context = C>,
impl<C> View for ChainManager<C>where
C: Context + Clone + Context + 'static,
RegisterView<C, ChainOwnership>: View<Context = C>,
RegisterView<C, u64>: View<Context = C>,
RegisterView<C, Option<WeightedAliasIndex<u64>>>: View<Context = C>,
RegisterView<C, Option<BlockProposal>>: View<Context = C>,
MapView<C, BlobId, Blob>: View<Context = C>,
RegisterView<C, Option<LockingBlock>>: View<Context = C>,
RegisterView<C, Option<TimeoutCertificate>>: View<Context = C>,
RegisterView<C, Option<Vote<ConfirmedBlock>>>: View<Context = C>,
RegisterView<C, Option<Vote<ValidatedBlock>>>: View<Context = C>,
RegisterView<C, Option<Vote<Timeout>>>: View<Context = C>,
RegisterView<C, Option<Timestamp>>: View<Context = C>,
RegisterView<C, Round>: View<Context = C>,
RegisterView<C, BTreeMap<AccountOwner, u64>>: View<Context = C>,
Source§const NUM_INIT_KEYS: usize
const NUM_INIT_KEYS: usize
Source§fn pre_load(context: &C) -> Result<Vec<Vec<u8>>, ViewError>
fn pre_load(context: &C) -> Result<Vec<Vec<u8>>, ViewError>
Source§fn post_load(context: C, values: &[Option<Vec<u8>>]) -> Result<Self, ViewError>
fn post_load(context: C, values: &[Option<Vec<u8>>]) -> Result<Self, ViewError>
Source§fn rollback(&mut self)
fn rollback(&mut self)
flush should have no effect to storage.Source§async fn has_pending_changes(&self) -> bool
async fn has_pending_changes(&self) -> bool
true if flushing this view would result in changes to the persistent storage.Source§fn pre_save(&self, batch: &mut Batch) -> Result<bool, ViewError>
fn pre_save(&self, batch: &mut Batch) -> Result<bool, ViewError>
batch variable.
The returned boolean indicates whether the operation removes the view or not.Source§fn post_save(&mut self)
fn post_save(&mut self)
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 moreimpl<C> ObjectType for ChainManager<C>
Auto Trait Implementations§
impl<C> Freeze for ChainManager<C>where
C: Freeze,
impl<C> RefUnwindSafe for ChainManager<C>where
C: RefUnwindSafe,
impl<C> Send for ChainManager<C>
impl<C> Sync for ChainManager<C>
impl<C> Unpin for ChainManager<C>where
C: Unpin,
impl<C> UnwindSafe for ChainManager<C>where
C: UnwindSafe,
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T> MockResults for T
impl<T> MockResults for T
Source§type Results = T
type Results = T
MockInstance.Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<M, I> RuntimeMemory<&mut I> for Mwhere
M: RuntimeMemory<I>,
impl<M, I> RuntimeMemory<&mut I> for Mwhere
M: RuntimeMemory<I>,
Source§fn read<'instance>(
&self,
instance: &'instance &mut I,
location: GuestPointer,
length: u32,
) -> Result<Cow<'instance, [u8]>, RuntimeError>
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>
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> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.