pub struct AllocationSession<S: StorageSubstrate> { /* private fields */ }Expand description
AllocationSession
Persisted allocation capability required before opening allocation slots.
Integrations should construct sessions only after recovering the ledger, validating declarations, and committing the next generation. Opening storage through this type keeps handle creation tied to the validated stable-key snapshot.
Implementations§
Source§impl<S: StorageSubstrate> AllocationSession<S>
impl<S: StorageSubstrate> AllocationSession<S>
Sourcepub const fn new(substrate: S, committed: CommittedAllocations) -> Self
pub const fn new(substrate: S, committed: CommittedAllocations) -> Self
Construct a session from a substrate and committed allocation set.
Sourcepub const fn committed(&self) -> &CommittedAllocations
pub const fn committed(&self) -> &CommittedAllocations
Borrow the committed allocation set.
Sourcepub fn open(
&self,
key: &StableKey,
) -> Result<S::MemoryHandle, AllocationSessionError<S::Error>>
pub fn open( &self, key: &StableKey, ) -> Result<S::MemoryHandle, AllocationSessionError<S::Error>>
Open an allocation by stable key.
Auto Trait Implementations§
impl<S> Freeze for AllocationSession<S>where
S: Freeze,
impl<S> RefUnwindSafe for AllocationSession<S>where
S: RefUnwindSafe,
impl<S> Send for AllocationSession<S>where
S: Send,
impl<S> Sync for AllocationSession<S>where
S: Sync,
impl<S> Unpin for AllocationSession<S>where
S: Unpin,
impl<S> UnsafeUnpin for AllocationSession<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for AllocationSession<S>where
S: UnwindSafe,
Blanket Implementations§
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
Mutably borrows from an owned value. Read more