Struct CwStorage

Source
#[repr(transparent)]
pub struct CwStorage<S: ?Sized>(pub S);
Expand description

A wrapper around a type implementing cosmwasm_std::Storage that integrates it with storey.

Tuple Fields§

§0: S

Trait Implementations§

Source§

impl<'a, S> IntoStorage<&'a CwStorage<S>> for (&'a S,)
where S: Storage + ?Sized,

Source§

fn into_storage(self) -> &'a CwStorage<S>

Source§

impl<'a, S> IntoStorage<&'a mut CwStorage<S>> for (&'a mut S,)
where S: Storage + ?Sized,

Source§

fn into_storage(self) -> &'a mut CwStorage<S>

Source§

impl<S> IterableStorage for CwStorage<S>
where S: Storage + ?Sized,

Source§

type KeysIterator<'a> = Box<dyn Iterator<Item = Vec<u8>> + 'a> where Self: 'a

The type of the iterator returned by keys.
Source§

type ValuesIterator<'a> = Box<dyn Iterator<Item = Vec<u8>> + 'a> where Self: 'a

The type of the iterator returned by values.
Source§

type PairsIterator<'a> = Box<dyn Iterator<Item = (Vec<u8>, Vec<u8>)> + 'a> where Self: 'a

The type of the iterator returned by pairs.
Source§

fn keys<'a>( &'a self, start: Bound<&[u8]>, end: Bound<&[u8]>, ) -> Self::KeysIterator<'a>

Get an iterator over keys. Read more
Source§

fn values<'a>( &'a self, start: Bound<&[u8]>, end: Bound<&[u8]>, ) -> Self::ValuesIterator<'a>

Get an iterator over values. Read more
Source§

fn pairs<'a>( &'a self, start: Bound<&[u8]>, end: Bound<&[u8]>, ) -> Self::PairsIterator<'a>

Get an iterator over key-value pairs. Read more
Source§

impl<S> RevIterableStorage for CwStorage<S>
where S: Storage + ?Sized,

Source§

type RevKeysIterator<'a> = Box<dyn Iterator<Item = Vec<u8>> + 'a> where Self: 'a

The type of the iterator returned by rev_keys.
Source§

type RevValuesIterator<'a> = Box<dyn Iterator<Item = Vec<u8>> + 'a> where Self: 'a

The type of the iterator returned by rev_values.
Source§

type RevPairsIterator<'a> = Box<dyn Iterator<Item = (Vec<u8>, Vec<u8>)> + 'a> where Self: 'a

The type of the iterator returned by rev_pairs.
Source§

fn rev_keys<'a>( &'a self, start: Bound<&[u8]>, end: Bound<&[u8]>, ) -> Self::RevKeysIterator<'a>

Get a reverse iterator over keys. Read more
Source§

fn rev_values<'a>( &'a self, start: Bound<&[u8]>, end: Bound<&[u8]>, ) -> Self::RevValuesIterator<'a>

Get a reverse iterator over values. Read more
Source§

fn rev_pairs<'a>( &'a self, start: Bound<&[u8]>, end: Bound<&[u8]>, ) -> Self::RevPairsIterator<'a>

Get a reverse iterator over key-value pairs. Read more
Source§

impl<S> StorageBackend for CwStorage<S>
where S: Storage + ?Sized,

Source§

fn get(&self, key: &[u8]) -> Option<Vec<u8>>

Get the value associated with the given key.
Source§

fn has(&self, key: &[u8]) -> bool

Check if the given key exists in the storage backend.
Source§

impl<S> StorageBackendMut for CwStorage<S>
where S: Storage + ?Sized,

Source§

fn set(&mut self, key: &[u8], value: &[u8])

Set the value associated with the given key.
Source§

fn remove(&mut self, key: &[u8])

Remove the value associated with the given key.

Auto Trait Implementations§

§

impl<S> Freeze for CwStorage<S>
where S: Freeze + ?Sized,

§

impl<S> RefUnwindSafe for CwStorage<S>
where S: RefUnwindSafe + ?Sized,

§

impl<S> Send for CwStorage<S>
where S: Send + ?Sized,

§

impl<S> Sync for CwStorage<S>
where S: Sync + ?Sized,

§

impl<S> Unpin for CwStorage<S>
where S: Unpin + ?Sized,

§

impl<S> UnwindSafe for CwStorage<S>
where S: UnwindSafe + ?Sized,

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<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. 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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<B> Storage for B
where B: StorageBackend + ?Sized,

Source§

fn get(&self, key: &[u8]) -> Option<Vec<u8>>

Get the value of the key.
Source§

fn has(&self, key: &[u8]) -> bool

Check if the key exists.
Source§

fn get_meta(&self, key: &[u8]) -> Option<Vec<u8>>

Get the value of the key in the metadata namespace.
Source§

fn has_meta(&self, key: &[u8]) -> bool

Check if the key exists in the metadata namespace.
Source§

impl<B> StorageMut for B

Source§

fn set(&mut self, key: &[u8], value: &[u8])

Set the value of the key.
Source§

fn remove(&mut self, key: &[u8])

Remove the key.
Source§

fn set_meta(&mut self, key: &[u8], value: &[u8])

Set the value of the key in the metadata namespace.
Source§

fn remove_meta(&mut self, key: &[u8])

Remove the key in the metadata namespace.
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V