Skip to main content

ActionEffect

Struct ActionEffect 

Source
pub struct ActionEffect {
Show 14 fields pub version: u32, pub async_tasks: Vec<Task>, pub status: StatusCode, pub value_changed: Vec<SheetCellId>, pub cell_removed: Vec<SheetCellId>, pub style_changed: Vec<SheetCellId>, pub row_inserted: Vec<SheetRowId>, pub row_removed: Vec<SheetRowId>, pub row_updated: Vec<SheetRowId>, pub col_inserted: Vec<SheetColId>, pub col_removed: Vec<SheetColId>, pub col_updated: Vec<SheetColId>, pub header_updated: Vec<u32>, pub error_message: Option<String>,
}
Expand description

ActionEffect represents the result of handling an EditAction.

Additionally, since LogiSheets allows developers to define their own functions, the engine may encounter functions it cannot compute directly. In such cases, the engine will return these tasks to the JavaScript side for further processing.

Fields§

§version: u32

The undo-history version after the action: it advances only when an undoable transaction is recorded. Undo, redo and rejections report 0. For change detection use Workbook::get_version (the revision).

§async_tasks: Vec<Task>

Tasks should be calculated outside this engine(mainly because of network limitations and customer defined)

§status: StatusCode

Err when the engine rejected the action. A rejection is reported here, not raised: callers that need the write to land must check it.

§value_changed: Vec<SheetCellId>

Cells whose value changed, including recalculated dependents. Undo and redo swap whole snapshots and leave all the change lists empty, so a host must re-read everything after them.

§cell_removed: Vec<SheetCellId>§style_changed: Vec<SheetCellId>§row_inserted: Vec<SheetRowId>§row_removed: Vec<SheetRowId>§row_updated: Vec<SheetRowId>

Never populated at present.

§col_inserted: Vec<SheetColId>§col_removed: Vec<SheetColId>§col_updated: Vec<SheetColId>

Never populated at present.

§header_updated: Vec<u32>

Sheet indices whose row-heights or column-widths changed. Lets the frontend re-render row/column headers (and any UI chrome whose position depends on row/column metrics) for those sheets without invalidating cell content.

§error_message: Option<String>

Why the action failed, when status is Err. The status code is a placeholder — every rejection is code 1 — so this is the only part a caller can act on. A rejected transaction names and quotes the payload it stopped at.

Implementations§

Source§

impl ActionEffect

Source

pub fn rejected(reason: String) -> ActionEffect

Source

pub fn from( version: u32, tasks: Vec<Task>, ty: WorkbookUpdateType, ) -> ActionEffect

Trait Implementations§

Source§

impl Clone for ActionEffect

Source§

fn clone(&self) -> ActionEffect

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ActionEffect

Source§

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

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

impl Default for ActionEffect

Source§

fn default() -> ActionEffect

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ActionEffect

Source§

fn deserialize<D>( deserializer: D, ) -> Result<ActionEffect, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<_GentsDummyActionEffect> for ActionEffect

Source§

fn from(value: _GentsDummyActionEffect) -> ActionEffect

Converts to this type from the input type.
Source§

impl Serialize for ActionEffect

Source§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TS for ActionEffect

Source§

fn _register(manager: &mut DescriptorManager, generic_base: bool) -> usize

Source§

fn _ts_name() -> String

Source§

fn _is_optional() -> bool

Source§

fn _tag() -> Option<&'static str>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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 = !

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

fn try_from(value: U) -> Result<T, !>

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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more