pub enum ReferenceResolution {
Object,
External,
Historical,
Missing,
}Expand description
How a typed reference resolved.
Four words and no fifth: a reference names an object of the index, or something only
the ledger and git can vouch for, or a file the tree no longer holds and git history
does, or nothing. external is not a weaker object — a commit or a task is exactly as
real as a rule — it says which reader answered; historical resolves as well, and is
named apart so a reader sees which provenance outlived its file (I1987).
use majordomus_cli::capability::builtin::knowledge_base::ReferenceResolution;
let r: ReferenceResolution = serde_json::from_str(r#""external""#).unwrap();
assert_eq!(r, ReferenceResolution::External);
assert!(r.resolves(), "vouched for by the ledger or git is resolved");
assert!(!ReferenceResolution::Missing.resolves());Variants§
Object
An object of the index: the target is its URI, or its path for a file.
External
Vouched for by the ledger, the task store or git: a session, a task, a decision, a commit.
Historical
A file: or test: the tree no longer holds and git history does: cited before the
file was deleted, or pinned as file:<path>@<commit>. The target is the blob that
answers, <commit>:<path>, which git show reads.
Missing
Nothing answers to it. A dangling reference is the integrity validator’s finding.
Implementations§
Source§impl ReferenceResolution
impl ReferenceResolution
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The word as serialised, for a text rendering that prints it beside the reference.
use majordomus_cli::capability::builtin::knowledge_base::ReferenceResolution;
assert_eq!(ReferenceResolution::External.as_str(), "external");
assert!(!ReferenceResolution::Missing.resolves());Trait Implementations§
Source§impl Clone for ReferenceResolution
impl Clone for ReferenceResolution
Source§fn clone(&self) -> ReferenceResolution
fn clone(&self) -> ReferenceResolution
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ReferenceResolution
Source§impl Debug for ReferenceResolution
impl Debug for ReferenceResolution
Source§impl<'de> Deserialize<'de> for ReferenceResolution
impl<'de> Deserialize<'de> for ReferenceResolution
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ReferenceResolution
Source§impl JsonSchema for ReferenceResolution
impl JsonSchema for ReferenceResolution
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Ord for ReferenceResolution
impl Ord for ReferenceResolution
Source§fn cmp(&self, other: &ReferenceResolution) -> Ordering
fn cmp(&self, other: &ReferenceResolution) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ReferenceResolution
impl PartialEq for ReferenceResolution
Source§fn eq(&self, other: &ReferenceResolution) -> bool
fn eq(&self, other: &ReferenceResolution) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ReferenceResolution
impl PartialOrd for ReferenceResolution
Source§impl Serialize for ReferenceResolution
impl Serialize for ReferenceResolution
impl StructuralPartialEq for ReferenceResolution
Auto Trait Implementations§
impl Freeze for ReferenceResolution
impl RefUnwindSafe for ReferenceResolution
impl Send for ReferenceResolution
impl Sync for ReferenceResolution
impl Unpin for ReferenceResolution
impl UnsafeUnpin for ReferenceResolution
impl UnwindSafe for ReferenceResolution
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
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§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
key and return true if they are equal.