Skip to main content

Process

Struct Process 

Source
pub struct Process { /* private fields */ }
Expand description

A business process of a domain, made with crate::Domain::process: its start and steps, added in the order written (see the module for an example). Cloning gives another handle to the same process. Process::model builds the model the kernel registers.

Implementations§

Source§

impl Process

Source

pub fn name(&self) -> String

Its qualified name: shop.fulfilment.

Source

pub fn start<E: EventType>(&self, start: Start) -> Process

Starts a case when an E event commits; see Start.

Source

pub fn start_named(&self, event_type: &str, start: Start) -> Process

Process::start with the event type by name: shop.OrderSubmitted, or OrderSubmitted of the process’s domain.

Source

pub fn command<C: CommandType>(&self, name: &str, send: Send) -> Process

A step name that sends a C command as the process; see Send.

Source

pub fn command_named( &self, name: &str, command_type: &str, send: Send, ) -> Process

Process::command with the command type by name: shop.order.Confirm, or order.Confirm of the process’s domain.

Source

pub fn wait<E: EventType>(&self, name: &str, wait: Wait) -> Process

A step name that waits for an E event of this case; see Wait.

Source

pub fn wait_named(&self, name: &str, event_type: &str, wait: Wait) -> Process

Process::wait with the event type by name: payments.PaymentReceived, or a type of the process’s domain.

Source

pub fn timer(&self, name: &str, timer: Timer) -> Process

A step name that waits for a time; see Timer.

Source

pub fn decide(&self, name: &str, decide: Decide) -> Process

A step name that picks a path by the case’s data; see Decide.

Source

pub fn query<Q: QueryType>(&self, name: &str, ask: Ask) -> Process

A step name that asks a Q query; its answer picks the path; see Ask.

Source

pub fn query_named(&self, name: &str, query_type: &str, ask: Ask) -> Process

Process::query with the query type by name: shop.NeedsApproval, or a type of the process’s domain.

Source

pub fn end(&self, name: &str) -> Process

A step name that ends the case.

Source

pub fn cancel_on<E: EventType>(&self, key: &str, end: &str) -> Process

Ends a running case at once when an E event of its key commits, whatever step it is at: key is where the case’s key is in the event (aggregate_id or data.<field>), end an end step. Its timer is withdrawn, an outcome it still awaits is ignored, an incident ends with it. Events the case’s own commands cause do not count.

Source

pub fn cancel_on_named(&self, event_type: &str, key: &str, end: &str) -> Process

Process::cancel_on with the event type by name: accounts.AccountClosed, or a type of the process’s domain.

Source

pub fn model(&self) -> Result<Value, Error>

The model the kernel registers (design/processes.md “The model format”): steps in the order written, each but end with its explicit successors, field names as on the wire. Error::Config naming the process and the step if it has no start, a step name is invalid or taken, a target names no step, a step other than end has no successor, a reference or duration is malformed, or a decision or query has no paths. The kernel checks the rest when it registers the model (conditions, types, grants).

Trait Implementations§

Source§

impl Clone for Process

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 Debug for Process

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for Process

§

impl Freeze for Process
where *const ArcInner<Mutex<Def>> is !null: Freeze, PhantomData<ArcInner<Mutex<Def>>>: Freeze,

§

impl Move for Process

§

impl RefUnwindSafe for Process

§

impl Send for Process
where Arc<Mutex<Def>>: Send,

§

impl Sync for Process
where Arc<Mutex<Def>>: Sync,

§

impl Unpin for Process
where Arc<Mutex<Def>>: Unpin,

§

impl UnsafeUnpin for Process
where *const ArcInner<Mutex<Def>> is !null: UnsafeUnpin, PhantomData<ArcInner<Mutex<Def>>>: UnsafeUnpin,

§

impl UnwindSafe for Process
where Arc<Mutex<Def>>: 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> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
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<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