pub struct HandoverObservation {
pub path: String,
pub freshness: Freshness,
pub reason: String,
pub divergence: String,
}Expand description
The handover a resuming worker would be given, judged by continuity’s own freshness rule.
use majordomus_cli::capability::builtin::continuity::Freshness;
use majordomus_cli::environment::preflight::{derive, HandoverObservation, Observations, Verdict};
let mut o = Observations::empty("demo", 0);
o.handover = Some(HandoverObservation {
path: "h.md".into(), freshness: Freshness::Aging, reason: "5h old".into(), divergence: "exact".into(),
});
assert_eq!(derive(&o).check("session.handover").unwrap().verdict, Verdict::Fresh);Fields§
§path: StringRepository-relative path.
freshness: FreshnessHow old it is, against the policy’s thresholds.
reason: StringWhy, in one phrase.
divergence: StringWhere its commit sits relative to HEAD.
Trait Implementations§
Source§impl Clone for HandoverObservation
impl Clone for HandoverObservation
Source§fn clone(&self) -> HandoverObservation
fn clone(&self) -> HandoverObservation
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 HandoverObservation
impl Debug for HandoverObservation
impl Eq for HandoverObservation
Source§impl PartialEq for HandoverObservation
impl PartialEq for HandoverObservation
Source§fn eq(&self, other: &HandoverObservation) -> bool
fn eq(&self, other: &HandoverObservation) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for HandoverObservation
Auto Trait Implementations§
impl Freeze for HandoverObservation
impl RefUnwindSafe for HandoverObservation
impl Send for HandoverObservation
impl Sync for HandoverObservation
impl Unpin for HandoverObservation
impl UnsafeUnpin for HandoverObservation
impl UnwindSafe for HandoverObservation
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.