pub struct ReportOutcome {
pub applied: usize,
pub through: u64,
pub cancel_requested: bool,
}Expand description
The outcome of one report from the process that runs an execution.
use majordomus_cli::execution::{Actor, EventPayload, ExecutionId, ExecutionState};
use majordomus_cli::execution::{ExecutionStore, Limits, RepositoryRef, Seed};
let store = ExecutionStore::new(Limits::default());
let seed = || Seed {
capability: "executions.demonstrate",
title: "Demonstrate an execution",
input: serde_json::json!({ "steps": 1 }),
cancellable: true,
actor: Actor::reported(4242),
repository: RepositoryRef { name: "r".into(), id: "id".into(), branch: None },
};
let id = ExecutionId::fresh();
store.adopt(id.clone(), seed(), 4242).unwrap();
// the reporter's own sequence: 1 is its `created`, already held here
use majordomus_cli::execution::ReportOutcome;
let outcome: ReportOutcome = store.report(&id, vec![(2, EventPayload::Started)]).unwrap();
assert_eq!((outcome.applied, outcome.through, outcome.cancel_requested), (1, 2, false));Fields§
§applied: usizeHow many of the reported events were applied here.
through: u64The reporter’s sequence this store holds everything up to: where its next report starts. Behind what was sent when the report had a gap in it.
cancel_requested: boolWhether somebody asked this process to stop the execution. Only the process that runs it can, so the reporter is told and cancels its own.
Trait Implementations§
Source§impl Clone for ReportOutcome
impl Clone for ReportOutcome
Source§fn clone(&self) -> ReportOutcome
fn clone(&self) -> ReportOutcome
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 moreSource§impl Debug for ReportOutcome
impl Debug for ReportOutcome
impl Eq for ReportOutcome
Source§impl PartialEq for ReportOutcome
impl PartialEq for ReportOutcome
Source§fn eq(&self, other: &ReportOutcome) -> bool
fn eq(&self, other: &ReportOutcome) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ReportOutcome
Auto Trait Implementations§
impl Freeze for ReportOutcome
impl RefUnwindSafe for ReportOutcome
impl Send for ReportOutcome
impl Sync for ReportOutcome
impl Unpin for ReportOutcome
impl UnsafeUnpin for ReportOutcome
impl UnwindSafe for ReportOutcome
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.