pub struct ChainModes { /* private fields */ }Expand description
The per-chain ListeningModes tracked by a local node, together with a memoized
Hashed of the fully-tracked subset.
The hash is the version of the outbox index (see
ChainStateView::outbox_index_tracked_hash). Caching it here — recomputed only when a chain
newly becomes FullChain, which is rare and client-side — lets every cross-chain operation
compare and reconcile the index in O(1) instead of rehashing the tracked set each time.
Implementations§
Source§impl ChainModes
impl ChainModes
Sourcepub fn new(modes: BTreeMap<ChainId, ListeningMode>) -> Self
pub fn new(modes: BTreeMap<ChainId, ListeningMode>) -> Self
Builds the listening modes from modes, computing the tracked-set hash once.
Sourcepub fn full(&self) -> Arc<Hashed<ChainIdSet>> ⓘ
pub fn full(&self) -> Arc<Hashed<ChainIdSet>> ⓘ
The fully-tracked chains together with their memoized hash (O(1) clone).
Sourcepub fn get(&self, chain_id: &ChainId) -> Option<&ListeningMode>
pub fn get(&self, chain_id: &ChainId) -> Option<&ListeningMode>
Returns the listening mode for chain_id, if it is tracked.
Sourcepub fn extend_mode(
&mut self,
chain_id: ChainId,
mode: ListeningMode,
) -> ListeningMode
pub fn extend_mode( &mut self, chain_id: ChainId, mode: ListeningMode, ) -> ListeningMode
Merges mode into the entry for chain_id — monotonic in the listening-mode order, so it
never weakens an existing entry — and returns the resulting mode. The tracked-set hash is
recomputed only if the chain newly became FullChain.
Trait Implementations§
Source§impl Debug for ChainModes
impl Debug for ChainModes
Auto Trait Implementations§
impl Freeze for ChainModes
impl RefUnwindSafe for ChainModes
impl Send for ChainModes
impl Sync for ChainModes
impl Unpin for ChainModes
impl UnsafeUnpin for ChainModes
impl UnwindSafe for ChainModes
Blanket Implementations§
impl<_INNER> AutoTraits for _INNER
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Requestimpl<T> MaybeSend for Twhere
T: Send,
impl<T> MaybeSync for Twhere
T: Sync,
impl<T> Post for Twhere
T: Send + 'static,
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.