Skip to main content

Mutation

Enum Mutation 

Source
pub enum Mutation {
    Cancel {
        namespace: String,
        workflow_id: String,
        run_id: String,
    },
    Terminate {
        namespace: String,
        workflow_id: String,
        run_id: String,
        reason: String,
    },
    Signal {
        namespace: String,
        workflow_id: String,
        run_id: String,
        name: String,
        input: Option<String>,
    },
    Delete {
        namespace: String,
        workflow_id: String,
        run_id: String,
    },
    Reset {
        namespace: String,
        workflow_id: String,
        run_id: String,
        event_id: i64,
        reason: String,
    },
    Update {
        namespace: String,
        workflow_id: String,
        run_id: String,
        name: String,
        input: Option<String>,
    },
    PauseSchedule {
        namespace: String,
        schedule_id: String,
        paused: bool,
    },
    TriggerSchedule {
        namespace: String,
        schedule_id: String,
    },
    DeleteSchedule {
        namespace: String,
        schedule_id: String,
    },
    CreateSchedule {
        namespace: String,
        schedule_id: String,
        workflow_id: String,
        workflow_type: String,
        task_queue: String,
        spec: String,
        input: Option<String>,
    },
    BackfillSchedule {
        namespace: String,
        schedule_id: String,
        range: TimeRange,
        overlap: Overlap,
    },
}
Expand description

A change to a cluster, fully specified.

Variants§

§

Cancel

Fields

§namespace: String
§workflow_id: String
§run_id: String
§

Terminate

Fields

§namespace: String
§workflow_id: String
§run_id: String
§reason: String
§

Signal

Fields

§namespace: String
§workflow_id: String
§run_id: String
§name: String
§input: Option<String>

JSON, as typed. None sends no input at all, which is not the same as null.

§

Delete

Fields

§namespace: String
§workflow_id: String
§run_id: String
§

Reset

Rewind to a completed workflow task and replay forward from there. The event id is already resolved to a valid reset point. See history::reset_point.

Fields

§namespace: String
§workflow_id: String
§run_id: String
§event_id: i64
§reason: String
§

Update

Send an update and wait for its outcome. Unlike a signal, an update can be rejected by the workflow and reports back.

Fields

§namespace: String
§workflow_id: String
§run_id: String
§name: String
§

PauseSchedule

Pause or resume a schedule. paused is the state being moved to.

Fields

§namespace: String
§schedule_id: String
§paused: bool
§

TriggerSchedule

Run a scheduled workflow now, without waiting for its next time.

Fields

§namespace: String
§schedule_id: String
§

DeleteSchedule

Fields

§namespace: String
§schedule_id: String
§

CreateSchedule

Create a schedule. spec is passed to the server as a cron string, which also accepts @every 1h.

Fields

§namespace: String
§schedule_id: String
§workflow_id: String
§workflow_type: String
§task_queue: String
§spec: String
§

BackfillSchedule

Replay every action the schedule would have taken over a past window.

Fields

§namespace: String
§schedule_id: String
§overlap: Overlap

Implementations§

Source§

impl Mutation

The three schedule operations act on a schedule id rather than an execution, so they do not share the workflow accessors.

Source

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

The schedule this acts on, if it is a schedule operation at all.

Source§

impl Mutation

Source

pub fn verb(&self) -> &'static str

What the confirmation calls it.

Source

pub fn past_tense(&self) -> &'static str

How to say it happened. Spelled out rather than derived: “cancel” + “d” is “canceld”, and a status line that cannot spell does not inspire confidence in what it just did.

Source

pub fn subject_plural(&self) -> &'static str

What a batch of this is a batch of, for the heading over a count.

Source

pub fn namespace(&self) -> &str

Source

pub fn workflow_id(&self) -> &str

Source

pub fn run_id(&self) -> &str

Source

pub fn is_destructive(&self) -> bool

Whether the workflow does not survive it.

A signal is a change but not a loss; a delete removes the history itself and cannot be walked back even by starting the workflow again.

Source

pub fn destroys_history(&self) -> bool

Whether it destroys the record as well as the run. Only delete does, which is why it is the one that asks for more than a keypress.

Source

pub fn cli(&self) -> String

The equivalent temporal command, ready to paste into a shell.

Flags follow temporal workflow --help: -w/--workflow-id, -r/--run-id, -n/--namespace, --reason, --name, --input. The long forms are used because this is meant to be read as much as run.

Source

pub fn audit_line( &self, at_epoch_millis: i64, target: Target<'_>, outcome: &str, ) -> String

One line for ~/.local/state/tmprl/audit.jsonl.

The CLI equivalent is recorded alongside the fields, so the log answers “what was actually done” without the reader having to reconstruct it from parts.

Trait Implementations§

Source§

impl Clone for Mutation

Source§

fn clone(&self) -> Mutation

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 Mutation

Source§

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

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

impl Eq for Mutation

Source§

impl PartialEq for Mutation

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Mutation

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 = !

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.