pub enum ClaimSource {
Claims(Vec<ClaimView>),
Unavailable(String),
}Expand description
Where the guard reads the mesh’s live claims: the running server’s own state, or that server asked over HTTP, or nothing when no server answers.
use majordomus_cli::guard::{judge_facts, ClaimSource, EditFacts};
let facts = |claims| EditFacts {
required: Ok(true),
mesh_enabled: true,
task: None,
session: Some("claude-code-s1"),
claims,
};
// the claims were read and none covers the path: refused
assert!(!judge_facts("a", Some("a"), facts(ClaimSource::Claims(vec![]))).allowed);
// nothing could be read: let through, and said
let v = judge_facts("a", Some("a"), facts(ClaimSource::Unavailable("no server".into())));
assert!(v.allowed);
assert!(v.detail.contains("no server"));Variants§
Claims(Vec<ClaimView>)
The claims, already read.
No server answers, or its answer could not be read: why.
Auto Trait Implementations§
impl Freeze for ClaimSource
impl RefUnwindSafe for ClaimSource
impl Send for ClaimSource
impl Sync for ClaimSource
impl Unpin for ClaimSource
impl UnsafeUnpin for ClaimSource
impl UnwindSafe for ClaimSource
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