pub struct State { /* private fields */ }Implementations§
Source§impl State
impl State
pub async fn new<KVS: KeyValueStore + 'static>( path: PathBuf, ) -> Result<Self, Error>
pub async fn set<F: Field>(&self, field: F) -> Result<(), Error>
pub async fn get_raw<F: Field>( &self, field: &F, ) -> Result<Option<Vec<u8>>, Error>
pub async fn get<F: Field, T: for<'a> Deserialize<'a>>( &self, field: &F, ) -> Result<Option<T>, Error>
pub async fn get_or_default<F: Field, T: for<'a> Deserialize<'a> + Default>( &self, field: &F, ) -> Result<T, Error>
pub async fn get_or_err<F: Field, T: for<'a> Deserialize<'a>>( &self, field: &F, ) -> Result<T, Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for State
impl !RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl !UnwindSafe for State
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