pub trait SupportsBatching<M, S>: BlueprintMutate<M, S>where
M: Mappable,
S: BatchOperations,{
// Required methods
fn init<'a, Iter>(
storage: &mut S,
column: S::Column,
set: Iter,
) -> StorageResult<()>
where Iter: 'a + Iterator<Item = (&'a M::Key, &'a M::Value)>,
M::Key: 'a,
M::Value: 'a;
fn insert<'a, Iter>(
storage: &mut S,
column: S::Column,
set: Iter,
) -> StorageResult<()>
where Iter: 'a + Iterator<Item = (&'a M::Key, &'a M::Value)>,
M::Key: 'a,
M::Value: 'a;
fn remove<'a, Iter>(
storage: &mut S,
column: S::Column,
set: Iter,
) -> StorageResult<()>
where Iter: 'a + Iterator<Item = &'a M::Key>,
M::Key: 'a;
}
Expand description
It is an extension of the blueprint that allows supporting batch operations. Usually, they are more performant than initializing/inserting/removing values one by one.
Required Methods§
Sourcefn init<'a, Iter>(
storage: &mut S,
column: S::Column,
set: Iter,
) -> StorageResult<()>
fn init<'a, Iter>( storage: &mut S, column: S::Column, set: Iter, ) -> StorageResult<()>
Initializes the storage with a bunch of key-value pairs.
In some cases, this method may be more performant than Self::insert
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.