Skip to main content

StorageImpl

Struct StorageImpl 

Source
pub struct StorageImpl<const N: usize, R, S> { /* private fields */ }

Implementations§

Source§

impl<const N: usize, R, S> StorageImpl<N, R, S>
where R: RawStorage, S: SerDe,

Source

pub const fn new(raw_storage: R, serde: S) -> Self

Source

pub fn raw_storage(&self) -> &R

Source

pub fn raw_storage_mut(&mut self) -> &mut R

Source

pub fn contains( &self, name: &str, ) -> Result<bool, StorageError<R::Error, S::Error>>

Source

pub fn remove( &mut self, name: &str, ) -> Result<bool, StorageError<R::Error, S::Error>>

Source

pub fn get<T>( &self, name: &str, ) -> Result<Option<T>, StorageError<R::Error, S::Error>>

Source

pub fn set<T>( &mut self, name: &str, value: &T, ) -> Result<bool, StorageError<R::Error, S::Error>>
where T: Serialize,

Trait Implementations§

Source§

impl<const N: usize, R, S> Storage for StorageImpl<N, R, S>
where R: RawStorage, S: SerDe,

Available on crate feature use_serde only.
Source§

fn get<T>(&self, name: &str) -> Result<Option<T>, Self::Error>

Source§

fn set<T>(&mut self, name: &str, value: &T) -> Result<bool, Self::Error>
where T: Serialize,

Source§

impl<const N: usize, R, S> StorageBase for StorageImpl<N, R, S>
where R: RawStorage, S: SerDe,

Available on crate feature use_serde only.
Source§

type Error = StorageError<<R as StorageBase>::Error, <S as SerDe>::Error>

Source§

fn contains(&self, name: &str) -> Result<bool, Self::Error>

Source§

fn remove(&mut self, name: &str) -> Result<bool, Self::Error>

Auto Trait Implementations§

§

impl<const N: usize, R, S> Freeze for StorageImpl<N, R, S>
where R: Freeze, S: Freeze,

§

impl<const N: usize, R, S> RefUnwindSafe for StorageImpl<N, R, S>

§

impl<const N: usize, R, S> Send for StorageImpl<N, R, S>
where R: Send, S: Send,

§

impl<const N: usize, R, S> Sync for StorageImpl<N, R, S>
where R: Sync, S: Sync,

§

impl<const N: usize, R, S> Unpin for StorageImpl<N, R, S>
where R: Unpin, S: Unpin,

§

impl<const N: usize, R, S> UnsafeUnpin for StorageImpl<N, R, S>
where R: UnsafeUnpin, S: UnsafeUnpin,

§

impl<const N: usize, R, S> UnwindSafe for StorageImpl<N, R, S>
where R: UnwindSafe, S: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.