pub enum DesiredMutation {
Create {
scope: CloudScope,
parent_id: CloudItemId,
name: String,
kind: CloudItemKind,
},
ModifyContent {
key: CloudItemKey,
},
ModifyMetadata {
key: CloudItemKey,
parent_id: Option<CloudItemId>,
name: Option<String>,
},
Delete {
key: CloudItemKey,
},
}Expand description
Product-neutral desired effect of a durable mutation.
Variants§
Create
Creates a child below an existing directory.
Fields
scope: CloudScopeNamespace/root scope in which the child will be created.
parent_id: CloudItemIdStable identity of the desired parent.
kind: CloudItemKindDesired item kind.
ModifyContent
Replaces local content for an existing file.
Fields
key: CloudItemKeyStable identity of the file being modified.
ModifyMetadata
Changes the parent, name, or both for an existing item.
Fields
key: CloudItemKeyStable identity preserved by the metadata mutation.
parent_id: Option<CloudItemId>Desired parent when this mutation moves the item.
Delete
Deletes an existing item.
Fields
key: CloudItemKeyStable identity of the item being deleted.
Implementations§
Source§impl DesiredMutation
impl DesiredMutation
Sourcepub fn create(
scope: CloudScope,
parent_id: CloudItemId,
name: impl Into<String>,
kind: CloudItemKind,
) -> Result<Self>
pub fn create( scope: CloudScope, parent_id: CloudItemId, name: impl Into<String>, kind: CloudItemKind, ) -> Result<Self>
Creates a child intent with a non-empty opaque name.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub const fn modify_content(key: CloudItemKey) -> Self
pub const fn modify_content(key: CloudItemKey) -> Self
Creates a content replacement intent.
Sourcepub fn modify_metadata(
key: CloudItemKey,
parent_id: Option<CloudItemId>,
name: Option<String>,
) -> Result<Self>
pub fn modify_metadata( key: CloudItemKey, parent_id: Option<CloudItemId>, name: Option<String>, ) -> Result<Self>
Creates a metadata intent that changes the parent, name, or both.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub const fn delete(key: CloudItemKey) -> Self
pub const fn delete(key: CloudItemKey) -> Self
Creates a delete intent.
Sourcepub const fn scope(&self) -> &CloudScope
pub const fn scope(&self) -> &CloudScope
Returns the namespace/root scope affected by this mutation.
Sourcepub const fn existing_item_key(&self) -> Option<&CloudItemKey>
pub const fn existing_item_key(&self) -> Option<&CloudItemKey>
Returns the existing item key when the mutation targets an already identified item.
Trait Implementations§
Source§impl Clone for DesiredMutation
impl Clone for DesiredMutation
Source§fn clone(&self) -> DesiredMutation
fn clone(&self) -> DesiredMutation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more