pub enum StorageAction {
Show 13 variants
Reference(BlockInfo, References),
Unreference(BlockInfo, References),
Structure(BTreeMap<WeakCid, References>),
ReferenceCreate(BlockInfo, References),
Remove(BlockInfo, BTreeSet<WeakCid>, bool),
Delete(BlockInfo, BTreeMap<WeakCid, BTreeSet<WeakCid>>, bool),
TagsInsert(BTreeSet<WeakCid>, Tags),
TagsRemove(BTreeSet<WeakCid>, Tags),
PinCreate(String, PinStrategy, References),
PinUpdate(String, PinStrategy),
PinReference(String, References),
PinRemove(String),
Batch(CoList<StorageAction>),
}Variants§
Reference(BlockInfo, References)
Increase [Cid] reference count by one.
Refernces are creates on-the-fly if not exist.
Shallow: [Cid] links are not added automatically (not recusrive).
§Args
- BlockInfo contains causality data about the reference
- The blocks to reference
- Tags will be merged with
BlockMetadata::tags
Unreference(BlockInfo, References)
Decrease [Cid] reference count by one.
Structure(BTreeMap<WeakCid, References>)
Structurally reference/delete [Cid].
Expects all children references passed for a parent even is they not exist on disk.
§Vec Arguments
0: The parent reference.1: The links of the parent reference.
ReferenceCreate(BlockInfo, References)
Create [Cid] references with ref count of zero if the reference not exists yet.
This is normally used to track newly created blocks.
§Arguments
0: The [Cid] of entries to create.
Remove(BlockInfo, BTreeSet<WeakCid>, bool)
Mark to remove [Cid]. This will make the references shallow again.
And eventually shedule them to delete.
§Note
This is basically the same as Unreference.
§Arguments
0: The BlockInfo of the blocks to remove.0: The [Cid] of entries to remove.1: Force remove all instances.
Delete(BlockInfo, BTreeMap<WeakCid, BTreeSet<WeakCid>>, bool)
Delete [Cid] references.
§Arguments
0: The [Cid] of entries to remove with all of its direct children.1: Force delete. If false only references with a zero ref count will be removed.
TagsInsert(BTreeSet<WeakCid>, Tags)
Append tags to references.
TagsRemove(BTreeSet<WeakCid>, Tags)
Remove tags from references.
PinCreate(String, PinStrategy, References)
Create a named pin and reference all specified [Cid]s.
PinUpdate(String, PinStrategy)
Update a named pin by setting the PinStrategy.
PinReference(String, References)
Insert references to a named pin and reference all specified [Cid]s.
PinRemove(String)
Remove a named pin and unreference all [Cid]s.
Batch(CoList<StorageAction>)
Batch process actions.
Trait Implementations§
Source§impl Clone for StorageAction
impl Clone for StorageAction
Source§fn clone(&self) -> StorageAction
fn clone(&self) -> StorageAction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StorageAction
impl Debug for StorageAction
Source§impl<'de> Deserialize<'de> for StorageAction
impl<'de> Deserialize<'de> for StorageAction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for StorageAction
impl Hash for StorageAction
Source§impl Ord for StorageAction
impl Ord for StorageAction
Source§fn cmp(&self, other: &StorageAction) -> Ordering
fn cmp(&self, other: &StorageAction) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for StorageAction
impl PartialEq for StorageAction
Source§impl PartialOrd for StorageAction
impl PartialOrd for StorageAction
Source§impl Reducer<StorageAction> for Storage
impl Reducer<StorageAction> for Storage
async fn reduce( state: OptionLink<Self>, event: Link<ReducerAction<StorageAction>>, storage: &CoreBlockStorage, ) -> Result<Link<Self>, Error>
Source§impl Serialize for StorageAction
impl Serialize for StorageAction
impl Eq for StorageAction
impl StructuralPartialEq for StorageAction
Auto Trait Implementations§
impl Freeze for StorageAction
impl RefUnwindSafe for StorageAction
impl Send for StorageAction
impl Sync for StorageAction
impl Unpin for StorageAction
impl UnsafeUnpin for StorageAction
impl UnwindSafe for StorageAction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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