Skip to main content

SMutView

Type Alias SMutView 

Source
pub type SMutView<'a, Backend, T, S> = State<StorageStateMut<'a, Backend>, T, S>;
Expand description

State view held by a mutable guard from a shared storage backend.

The alias is mainly documentation for return types. For example, SArcMutex<T>::borrow_mut::<Connected>() returns an SMutView<'_, MutexStorage, T, Connected>. In user-facing methods, prefer the shorter arbitrary-self receiver form:

fn authenticate<S>(
    self: magicstatemachines::State<S, Self, Connected>,
    user: String,
) -> magicstatemachines::State<S, Self, Authenticated>
where
    S: magicstatemachines::SMut,
{
    magicstatemachines::transition!(self, user)
}

Aliased Type§

pub struct SMutView<'a, Backend, T, S> { /* private fields */ }