Expand description
A guard for a state value.
Implementations
sourceimpl<'r, T: Send + Sync + 'static> State<'r, T>
impl<'r, T: Send + Sync + 'static> State<'r, T>
sourcepub fn inner(&self) -> &'r T
pub fn inner(&self) -> &'r T
Retrieve a borrow to the underlying value with a lifetime of 'r
.
Using this method is typically unnecessary as State
implements
std::ops::Deref
with a std::ops::Deref::Target
of T
.
Trait Implementations
sourceimpl<'r, 'de: 'r, T: Send + Sync + 'static, R: Runtime> CommandArg<'de, R> for State<'r, T>
impl<'r, 'de: 'r, T: Send + Sync + 'static, R: Runtime> CommandArg<'de, R> for State<'r, T>
sourcefn from_command(command: CommandItem<'de, R>) -> Result<Self, InvokeError>
fn from_command(command: CommandItem<'de, R>) -> Result<Self, InvokeError>
Grabs the State
from the CommandItem
. This will never fail.
Auto Trait Implementations
impl<'r, T> RefUnwindSafe for State<'r, T>where
T: RefUnwindSafe,
impl<'r, T> Send for State<'r, T>
impl<'r, T> Sync for State<'r, T>
impl<'r, T> Unpin for State<'r, T>
impl<'r, T> UnwindSafe for State<'r, T>where
T: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more