pub enum PointerLayout {
Pointer,
Inline,
Absent,
}Expand description
The layout of the pointer, which is how far the per-provider migration has got here.
Before the episode was keyed by its provider session, session-current.yaml was the
open record: one regular file, one episode per checkout. Seven concurrent sessions on
2026-09-09 produced one record between them under that layout. A regular file here today
is a checkout that has not run the migration, and its episodes are being overwritten.
Only one of the three is a finding, and it is the middle one. Pointer is the current
layout and Absent means no episode is open here — a fresh clone, or a worker between
episodes — while Inline is a checkout still on the pre-migration layout, where a
second concurrent session silently overwrites the first one’s record. So the question a
reader asks of this value is not “which layout” but “is it Inline”.
use majordomus_cli::capability::builtin::lifecycle::PointerLayout;
// the two that are fine, and the one that loses records
let loses_records = |l: PointerLayout| l == PointerLayout::Inline;
assert!(!loses_records(PointerLayout::Pointer));
assert!(!loses_records(PointerLayout::Absent), "no episode open is not a fault");
assert!(loses_records(PointerLayout::Inline));
// serialised as the word `as_str` gives
assert_eq!(
serde_json::to_value(PointerLayout::Absent).unwrap(),
serde_json::json!(PointerLayout::Absent.as_str()),
);Variants§
Pointer
A symlink into sessions-open/: the per-provider layout.
Inline
A regular file: the pre-migration layout, one episode per checkout.
Absent
Nothing is there. No episode is open here, which is not a fault.
Implementations§
Source§impl PointerLayout
impl PointerLayout
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The word this layout is reported and serialised under. Named for what the pointer is rather than for the migration that produced it, so that the value still reads correctly once nobody remembers there was a migration.
use majordomus_cli::capability::builtin::lifecycle::PointerLayout;
assert_eq!(PointerLayout::Inline.as_str(), "inline");
// the serialised form is this word, not a second rendering of the same value
assert_eq!(
serde_json::to_value(PointerLayout::Inline).unwrap(),
serde_json::json!(PointerLayout::Inline.as_str()),
);Trait Implementations§
Source§impl Clone for PointerLayout
impl Clone for PointerLayout
Source§fn clone(&self) -> PointerLayout
fn clone(&self) -> PointerLayout
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 PointerLayout
Source§impl Debug for PointerLayout
impl Debug for PointerLayout
Source§impl<'de> Deserialize<'de> for PointerLayout
impl<'de> Deserialize<'de> for PointerLayout
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 PointerLayout
Source§impl JsonSchema for PointerLayout
impl JsonSchema for PointerLayout
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 PointerLayout
impl Ord for PointerLayout
Source§fn cmp(&self, other: &PointerLayout) -> Ordering
fn cmp(&self, other: &PointerLayout) -> 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 PointerLayout
impl PartialEq for PointerLayout
Source§fn eq(&self, other: &PointerLayout) -> bool
fn eq(&self, other: &PointerLayout) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for PointerLayout
impl PartialOrd for PointerLayout
Source§impl Serialize for PointerLayout
impl Serialize for PointerLayout
impl StructuralPartialEq for PointerLayout
Auto Trait Implementations§
impl Freeze for PointerLayout
impl RefUnwindSafe for PointerLayout
impl Send for PointerLayout
impl Sync for PointerLayout
impl Unpin for PointerLayout
impl UnsafeUnpin for PointerLayout
impl UnwindSafe for PointerLayout
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.