Struct StoreContext
pub struct StoreContext<'a, T>(/* private fields */);
Expand description
Implementations§
§impl<'a, T> StoreContext<'a, T>
impl<'a, T> StoreContext<'a, T>
pub fn data(&self) -> &'a T
pub fn data(&self) -> &'a T
Access the underlying data owned by this Store
.
Same as Store::data
.
pub fn get_fuel(&self) -> Result<u64, Error>
pub fn get_fuel(&self) -> Result<u64, Error>
Returns the remaining fuel in this store.
For more information see Store::get_fuel
.
Trait Implementations§
§impl<T> AsContext for StoreContext<'_, T>
impl<T> AsContext for StoreContext<'_, T>
§fn as_context(&self) -> StoreContext<'_, T>
fn as_context(&self) -> StoreContext<'_, T>
Returns the store context that this type provides access to.
§impl<'a, T> From<StoreContextMut<'a, T>> for StoreContext<'a, T>
impl<'a, T> From<StoreContextMut<'a, T>> for StoreContext<'a, T>
§fn from(store: StoreContextMut<'a, T>) -> StoreContext<'a, T>
fn from(store: StoreContextMut<'a, T>) -> StoreContext<'a, T>
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a, T> Freeze for StoreContext<'a, T>
impl<'a, T> !RefUnwindSafe for StoreContext<'a, T>
impl<'a, T> Send for StoreContext<'a, T>where
T: Sync,
impl<'a, T> Sync for StoreContext<'a, T>where
T: Sync,
impl<'a, T> Unpin for StoreContext<'a, T>
impl<'a, T> !UnwindSafe for StoreContext<'a, T>
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
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> ⓘ
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 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> ⓘ
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