pub struct Pointer {
pub layout: PointerLayout,
pub target: String,
pub resolves: bool,
pub session_id: String,
pub note: String,
}Expand description
What the pointer is and whether it leads anywhere.
layout and resolves are independent, and the interesting case is the pair
Pointer + resolves: false: a symlink that survived the episode it named, which is
what a killed close or a hand-removed record leaves behind. The layout is right, the
destination is gone, and continuity.state has nothing to report while the store may
still hold open episodes — so this is a dangling pointer, not an empty store.
use majordomus_cli::capability::builtin::lifecycle::{Pointer, PointerLayout};
use serde_json::json;
// the healthy case: the current layout, and it leads to an episode
let live: Pointer = serde_json::from_value(json!({
"layout": "pointer",
"target": "sessions-open/claude-abc.yaml",
"resolves": true,
"session_id": "s-0002",
"note": "the pointer resolves to an open episode",
})).unwrap();
assert_eq!(live.layout, PointerLayout::Pointer);
assert!(live.resolves && !live.session_id.is_empty());
// and the dangling one: the right layout, aimed at a record that is no longer there
let dangling: Pointer = serde_json::from_value(json!({
"layout": "pointer",
"target": "sessions-open/claude-gone.yaml",
"resolves": false,
"note": "the symlink outlived the episode it named",
})).unwrap();
assert_eq!(dangling.layout, PointerLayout::Pointer, "the layout is not the fault");
assert!(!dangling.resolves);
assert!(dangling.session_id.is_empty(), "there is no episode to name");Fields§
§layout: PointerLayoutThe layout.
target: StringWhat the symlink names, as written, when it is one.
resolves: boolWhether reading through it yields an episode.
session_id: StringThe episode it resolves to.
note: StringWhat that means, in words.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Pointer
impl<'de> Deserialize<'de> for Pointer
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Pointer
Source§impl JsonSchema for Pointer
impl JsonSchema for Pointer
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for Pointer
Auto Trait Implementations§
impl Freeze for Pointer
impl RefUnwindSafe for Pointer
impl Send for Pointer
impl Sync for Pointer
impl Unpin for Pointer
impl UnsafeUnpin for Pointer
impl UnwindSafe for Pointer
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<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
Compare self to
key and return true if they are equal.