Skip to main content

MutationResult

Enum MutationResult 

Source
pub enum MutationResult<E: EntityKind> {
    Count {
        row_count: u32,
    },
    Entity(E),
    Entities(Vec<E>),
}
Expand description

MutationResult

Unified facade result for authored write operations. This keeps insert, create, update, replace, structural mutation, batch mutation, and count-first delete under one public result family instead of exposing separate single-row, batch-row, and bare-count payload types.

Variants§

§

Count

Fields

§row_count: u32
§

Entity(E)

§

Entities(Vec<E>)

Implementations§

Source§

impl<E: EntityKind> MutationResult<E>

Source

pub const fn from_count(row_count: u32) -> Self

Construct one count-only mutation result.

Source

pub const fn from_entity(entity: E) -> Self

Construct one single-entity mutation result.

Source

pub const fn from_entities(entities: Vec<E>) -> Self

Construct one multi-entity mutation result.

Source

pub fn from_core_batch(inner: CoreWriteBatchResponse<E>) -> Self

Construct one multi-entity mutation result from the core batch surface.

Source

pub fn row_count(&self) -> u32

Return the number of rows represented by this mutation result.

Source

pub fn count(&self) -> u32

Return the number of rows represented by this mutation result.

Source

pub fn is_empty(&self) -> bool

Return whether this result contains no rows.

Source

pub fn exists(&self) -> bool

Return whether this result contains at least one row.

Source

pub fn entity(self) -> Result<E, Error>

Consume and return exactly one entity.

Source

pub fn entities(self) -> Result<Vec<E>, Error>

Consume and return all entities represented by this result.

Source§

impl<E: EntityKind + EntityValue> MutationResult<E>

Source

pub fn id(&self) -> Result<Id<E>, Error>

Borrow exactly one primary identity from this mutation result.

Source

pub fn ids(&self) -> Result<Vec<Id<E>>, Error>

Borrow all primary identities from this mutation result.

Trait Implementations§

Source§

impl<E: Debug + EntityKind> Debug for MutationResult<E>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<E> Freeze for MutationResult<E>
where E: Freeze,

§

impl<E> RefUnwindSafe for MutationResult<E>
where E: RefUnwindSafe,

§

impl<E> Send for MutationResult<E>
where E: Send,

§

impl<E> Sync for MutationResult<E>
where E: Sync,

§

impl<E> Unpin for MutationResult<E>
where E: Unpin,

§

impl<E> UnsafeUnpin for MutationResult<E>
where E: UnsafeUnpin,

§

impl<E> UnwindSafe for MutationResult<E>
where E: UnwindSafe,

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> 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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V