pub struct PendingDeadline {
pub label: String,
pub due_at: OffsetDateTime,
}Expand description
A deadline that a Workflow::handle function wishes to register,
expressed without the process-identity fields that are only known to the
engine’s execution context.
The engine converts PendingDeadline into a fully-typed Deadline by
injecting stream_id, process_id, tenant_id, and workflow_id from
the active CommandContext. Workflows therefore stay pure (no I/O).
§Usage
Return PendingDeadline inside WorkflowOutput when the command must
register a regulatory deadline alongside its events and outbox messages:
ⓘ
use mako_engine::fristen::{APERAK_STROM_WINDOW_LABEL, aperak_strom_due_at};
use mako_engine::workflow::PendingDeadline;
let due = aperak_strom_due_at(received_at);
let dl = PendingDeadline::new(APERAK_STROM_WINDOW_LABEL, due);
Ok(WorkflowOutput::with_outbox_and_deadline(events, outbox, dl))Fields§
§label: StringDeadline label (matches the on_deadline match arm in the workflow).
due_at: OffsetDateTimeAbsolute UTC time at which the deadline fires.
Implementations§
Source§impl PendingDeadline
impl PendingDeadline
Sourcepub fn new(label: impl Into<String>, due_at: OffsetDateTime) -> Self
pub fn new(label: impl Into<String>, due_at: OffsetDateTime) -> Self
Create a new pending deadline with the given label and due time.
Trait Implementations§
Source§impl Clone for PendingDeadline
impl Clone for PendingDeadline
Source§fn clone(&self) -> PendingDeadline
fn clone(&self) -> PendingDeadline
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PendingDeadline
impl RefUnwindSafe for PendingDeadline
impl Send for PendingDeadline
impl Sync for PendingDeadline
impl Unpin for PendingDeadline
impl UnsafeUnpin for PendingDeadline
impl UnwindSafe for PendingDeadline
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more