pub struct LocalState { /* private fields */ }Expand description
LocalState is a state provider for testing purposes
It stores all the serialized states into a single DashMap
Implementations§
Source§impl LocalState
impl LocalState
pub fn new() -> LocalState
Trait Implementations§
Source§impl Debug for LocalState
impl Debug for LocalState
Source§impl Default for LocalState
impl Default for LocalState
Source§fn default() -> LocalState
fn default() -> LocalState
Returns the “default value” for a type. Read more
Source§impl<T: DeserializeOwned> StateLoader<T> for LocalState
impl<T: DeserializeOwned> StateLoader<T> for LocalState
fn load<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
object_kind: &'life1 str,
object_id: &'life2 str,
state_type: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<T, LoadStateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Source§fn prepare<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn prepare<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
TODO
Read more
Source§impl<T: Serialize + Send + Sync> StateSaver<T> for LocalState
impl<T: Serialize + Send + Sync> StateSaver<T> for LocalState
fn save<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
object_kind: &'life1 str,
object_id: &'life2 str,
state_type: &'life3 str,
data: &'life4 T,
) -> Pin<Box<dyn Future<Output = Result<(), LoadStateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn prepare<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl Freeze for LocalState
impl !RefUnwindSafe for LocalState
impl Send for LocalState
impl Sync for LocalState
impl Unpin for LocalState
impl UnsafeUnpin for LocalState
impl UnwindSafe for LocalState
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