Trait rings_core::storage::Storage
source · [−]pub trait Storage {
type K;
type V;
fn new() -> Self;
fn len(&self) -> usize;
fn is_empty(&self) -> bool;
fn get(&self, addr: &Self::K) -> Option<Self::V>;
fn set(&self, addr: &Self::K, value: Self::V) -> Option<Self::V>;
fn get_or_set(&self, addr: &Self::K, default: Self::V) -> Self::V;
fn keys(&self) -> Vec<Self::K>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator, ;
fn values(&self) -> Vec<Self::V>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator, ;
fn items(&self) -> Vec<(Self::K, Self::V)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator, ;
fn remove(&self, addr: &Self::K) -> Option<(Self::K, Self::V)>;
}Required Associated Types
Required Methods
fn get_or_set(&self, addr: &Self::K, default: Self::V) -> Self::V
fn keys(&self) -> Vec<Self::K>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
fn values(&self) -> Vec<Self::V>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,