Struct sp_trie::KeySpacedDBMut
source · pub struct KeySpacedDBMut<'a, DB: ?Sized, H>(_, _, _);
Expand description
HashDBMut
implementation that append a encoded prefix (unique id bytes) in addition to the
prefix of every key value.
Mutable variant of KeySpacedDB
, see KeySpacedDB
.
Implementations§
source§impl<'a, DB: ?Sized, H> KeySpacedDBMut<'a, DB, H>
impl<'a, DB: ?Sized, H> KeySpacedDBMut<'a, DB, H>
sourcepub fn new(db: &'a mut DB, ks: &'a [u8]) -> Self
pub fn new(db: &'a mut DB, ks: &'a [u8]) -> Self
instantiate new keyspaced db
Trait Implementations§
source§impl<'a, DB, H, T> AsHashDB<H, T> for KeySpacedDBMut<'a, DB, H>where
DB: HashDB<H, T>,
H: Hasher,
T: Default + PartialEq<T> + for<'b> From<&'b [u8]> + Clone + Send + Sync,
impl<'a, DB, H, T> AsHashDB<H, T> for KeySpacedDBMut<'a, DB, H>where DB: HashDB<H, T>, H: Hasher, T: Default + PartialEq<T> + for<'b> From<&'b [u8]> + Clone + Send + Sync,
source§fn as_hash_db(&self) -> &dyn HashDB<H, T>
fn as_hash_db(&self) -> &dyn HashDB<H, T>
Perform upcast to HashDB for anything that derives from HashDB.
source§fn as_hash_db_mut<'b>(&'b mut self) -> &'b mut (dyn HashDB<H, T> + 'b)
fn as_hash_db_mut<'b>(&'b mut self) -> &'b mut (dyn HashDB<H, T> + 'b)
Perform mutable upcast to HashDB for anything that derives from HashDB.
source§impl<'a, DB, H, T> HashDB<H, T> for KeySpacedDBMut<'a, DB, H>where
DB: HashDB<H, T>,
H: Hasher,
T: Default + PartialEq<T> + for<'b> From<&'b [u8]> + Clone + Send + Sync,
impl<'a, DB, H, T> HashDB<H, T> for KeySpacedDBMut<'a, DB, H>where DB: HashDB<H, T>, H: Hasher, T: Default + PartialEq<T> + for<'b> From<&'b [u8]> + Clone + Send + Sync,
source§fn get(&self, key: &H::Out, prefix: Prefix<'_>) -> Option<T>
fn get(&self, key: &H::Out, prefix: Prefix<'_>) -> Option<T>
Look up a given hash into the bytes that hash to it, returning None if the
hash is not known.
source§fn contains(&self, key: &H::Out, prefix: Prefix<'_>) -> bool
fn contains(&self, key: &H::Out, prefix: Prefix<'_>) -> bool
Check for the existence of a hash-key.
source§fn insert(&mut self, prefix: Prefix<'_>, value: &[u8]) -> H::Out
fn insert(&mut self, prefix: Prefix<'_>, value: &[u8]) -> H::Out
Insert a datum item into the DB and return the datum’s hash for a later lookup. Insertions
are counted and the equivalent number of
remove()
s must be performed before the data
is considered dead.Auto Trait Implementations§
impl<'a, DB: ?Sized, H> RefUnwindSafe for KeySpacedDBMut<'a, DB, H>where DB: RefUnwindSafe, H: RefUnwindSafe,
impl<'a, DB: ?Sized, H> Send for KeySpacedDBMut<'a, DB, H>where DB: Send, H: Send,
impl<'a, DB: ?Sized, H> Sync for KeySpacedDBMut<'a, DB, H>where DB: Sync, H: Sync,
impl<'a, DB: ?Sized, H> Unpin for KeySpacedDBMut<'a, DB, H>where H: Unpin,
impl<'a, DB, H> !UnwindSafe for KeySpacedDBMut<'a, DB, H>
Blanket Implementations§
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, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.