pub struct AllocationSession<S: StorageSubstrate> { /* private fields */ }Expand description
AllocationSession
Validated capability required before opening allocation slots.
Implementations§
Source§impl<S: StorageSubstrate> AllocationSession<S>
impl<S: StorageSubstrate> AllocationSession<S>
Sourcepub const fn new(substrate: S, validated: ValidatedAllocations) -> Self
pub const fn new(substrate: S, validated: ValidatedAllocations) -> Self
Construct a session from a substrate and validated allocation set.
Sourcepub const fn validated(&self) -> &ValidatedAllocations
pub const fn validated(&self) -> &ValidatedAllocations
Borrow the validated 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