DesiredMutation

Enum DesiredMutation 

Source
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: CloudScope

Namespace/root scope in which the child will be created.

§parent_id: CloudItemId

Stable identity of the desired parent.

§name: String

Desired child name, preserved without product normalization.

§kind: CloudItemKind

Desired item kind.

§

ModifyContent

Replaces local content for an existing file.

Fields

§key: CloudItemKey

Stable identity of the file being modified.

§

ModifyMetadata

Changes the parent, name, or both for an existing item.

Fields

§key: CloudItemKey

Stable identity preserved by the metadata mutation.

§parent_id: Option<CloudItemId>

Desired parent when this mutation moves the item.

§name: Option<String>

Desired name when this mutation renames the item.

§

Delete

Deletes an existing item.

Fields

§key: CloudItemKey

Stable identity of the item being deleted.

Implementations§

Source§

impl DesiredMutation

Source

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.

Source

pub const fn modify_content(key: CloudItemKey) -> Self

Creates a content replacement intent.

Source

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.

Source

pub const fn delete(key: CloudItemKey) -> Self

Creates a delete intent.

Source

pub const fn scope(&self) -> &CloudScope

Returns the namespace/root scope affected by this mutation.

Source

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

Source§

fn clone(&self) -> DesiredMutation

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DesiredMutation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for DesiredMutation

Source§

fn eq(&self, other: &DesiredMutation) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for DesiredMutation

Source§

impl StructuralPartialEq for DesiredMutation

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.