Skip to main content

ChainStateViewReadGuard

Struct ChainStateViewReadGuard 

Source
pub struct ChainStateViewReadGuard<S: Storage>(/* private fields */);
Expand description

A read guard providing access to a chain’s ChainStateView.

Holds a read lock on the chain worker state, preventing writes for its lifetime. The OwnedRwLockReadGuard internally holds a strong Arc reference to the RwLock<ChainWorkerState>, keeping the state alive. Dereferences to ChainStateView.

Methods from Deref<Target = ChainStateView<S::Context>>§

Source

pub async fn execution_state( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&ExecutionStateView<C>, Error>

Source

pub async fn execution_state_hash( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&RegisterView<C, Option<CryptoHash>>, Error>

Source

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

Source

pub async fn manager( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&ChainManager<C>, Error>

Source

pub async fn pending_validated_blobs( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&PendingBlobsView<C>, Error>

Source

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

Source

pub async fn confirmed_log( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&LogView<C, CryptoHash>, Error>

Source

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

Source

pub async fn received_certificate_trackers( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&RegisterView<C, HashMap<Secp256k1PublicKey, u64>>, Error>

Source

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

Source

pub async fn unskippable_bundles( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&BucketQueueView<C, TimestampedBundleInInbox, linera_chain::::chain::{impl#20}::unskippable_bundles::{constant#0}>, Error>

Source

pub async fn removed_unskippable_bundles( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&SetView<C, BundleInInbox>, Error>

Source

pub async fn previous_message_blocks( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&MapView<C, ChainId, BlockHeight>, Error>

Source

pub async fn previous_event_blocks( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&MapView<C, StreamId, BlockHeight>, Error>

Source

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

Source

pub async fn outbox_counters( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&RegisterView<C, BTreeMap<BlockHeight, u32>>, Error>

Source

pub async fn nonempty_outboxes( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&RegisterView<C, BTreeSet<ChainId>>, Error>

Source

pub async fn preprocessed_blocks( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&MapView<C, BlockHeight, CryptoHash>, Error>

Source

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

Source

pub async fn nonempty_inboxes( &self, ctx: &ContextBase<'_, &Positioned<Field>>, ) -> Result<&RegisterView<C, Option<BTreeSet<ChainId>>>, Error>

Source

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

Source

pub fn chain_id(&self) -> ChainId

Returns the ChainId of the chain this ChainStateView represents.

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 next_height_to_preprocess(&self) -> Result<BlockHeight, ChainError>

Returns the height of the highest block we have, plus one. Includes preprocessed blocks.

The “+ 1” is so that it can be used in the same places as next_block_height.

Source

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

Source

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

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 is_child(&self) -> Result<bool, ChainError>

Returns whether this is a child chain.

Source

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

Returns the hashes of all blocks we have in the given range.

If the input heights are in ascending order, the hashes will be in the same order. Otherwise they may be unordered.

Trait Implementations§

Source§

impl<S: Storage> Deref for ChainStateViewReadGuard<S>

Source§

type Target = ChainStateView<<S as Storage>::Context>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
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<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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, 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> 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> Post for T
where T: Send + 'static,