Skip to main content

Invoke

Struct Invoke 

Source
pub struct Invoke<R> {
    pub id: &'static str,
    pub arguments: Map<String, Value>,
    /* private fields */
}
Expand description

One fully specified invocation of a declared action, or of one of the app’s effects (Invoke::effect).

Fields§

§id: &'static str§arguments: Map<String, Value>

Implementations§

Source§

impl<R> Invoke<R>

Source

pub fn effect<E: Effect>(effect: &E) -> Self

An invocation of one of the app’s effects — show an item, refresh a list — through the same API as its actions: what a launch asks of an app beside editing its resource (tilo-store:app/<id> showing that app). It changes no document, so it never builds an action.

An effect offered only on rows (#[effect(row, on = Page)]) acts on the row it is invoked on: name it with Self::on. Until then it refuses, saying so, since the resource does not offer it.

Source

pub fn on(self, row: impl Into<String>) -> Self

This invocation on the published row row (the Browser’s page, one download), which offers its action, rather than on the resource.

Source

pub fn row(&self) -> Option<&str>

The published row it acts on, when Self::on named one.

Source

pub fn refusal(&self) -> Option<&str>

Why the input this invocation was built from does not bind: such an invocation refuses wherever it is submitted.

Source

pub fn is_effect(&self) -> bool

Whether this invokes an effect (Self::effect) rather than one of the resource’s actions.

Source

pub fn address_on(&self, resource: impl Into<String>) -> ActionAddress

This invocation’s action as the published resource resource (an item of the record, a child, a live row) offers it.

Source§

impl<R: Resource> Invoke<R>

Source

pub fn address(&self) -> ActionAddress

This invocation’s action as the record’s own resource publishes it.

Source

pub fn apply(action: &R::Action) -> Result<Self, Error>

An invocation of the generic APPLY action for one typed action value — the path for edits without a named declaration.

§Errors

Returns the serialization error of action.

Source

pub fn edit(edit: &Edit<R>) -> Result<Self, Error>

An invocation of the field edit edit (FIELD_EDIT).

§Errors

Returns the serialization error of edit.

Source

pub fn group(members: impl IntoIterator<Item = Self>) -> Self

Several invocations applied as one action: one change, one version, one undo step. Members that are groups themselves are flattened.

Source

pub fn is_group(&self) -> bool

Whether this is a group of invocations.

Source

pub fn build(&self, now_ms: i64) -> Result<R::Action, String>

Build the replayable action on this (origin) machine. A group builds with build_group.

Trait Implementations§

Source§

impl<R> Clone for Invoke<R>

Source§

fn clone(&self) -> Self

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<R> Debug for Invoke<R>

Source§

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

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

impl<R: Resource> From<&Edit<R>> for Invoke<R>

Source§

fn from(edit: &Edit<R>) -> Self

Converts to this type from the input type.
Source§

impl<R: Resource> From<Edit<R>> for Invoke<R>

Source§

fn from(edit: Edit<R>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<R> Forget for Invoke<R>

§

impl<R> Freeze for Invoke<R>
where PhantomData<fn() -> R>: Freeze,

§

impl<R> Move for Invoke<R>

§

impl<R> RefUnwindSafe for Invoke<R>
where PhantomData<fn() -> R>: RefUnwindSafe,

§

impl<R> Send for Invoke<R>
where PhantomData<fn() -> R>: Send,

§

impl<R> Sync for Invoke<R>
where PhantomData<fn() -> R>: Sync,

§

impl<R> Unpin for Invoke<R>
where PhantomData<fn() -> R>: Unpin,

§

impl<R> UnsafeUnpin for Invoke<R>
where PhantomData<fn() -> R>: UnsafeUnpin,

§

impl<R> UnwindSafe for Invoke<R>
where PhantomData<fn() -> R>: 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> 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> 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> Same for T

Source§

type Output = T

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