pub struct FrictionLedger { /* private fields */ }Expand description
Append-side handle. Cheap to construct per refusal — no state beyond the target path and the cap.
Implementations§
Source§impl FrictionLedger
impl FrictionLedger
Sourcepub fn for_workspace(workspace_root: &Path) -> Self
pub fn for_workspace(workspace_root: &Path) -> Self
The workspace’s ledger with the default cap.
Sourcepub fn at_path(path: PathBuf, cap_bytes: u64) -> Self
pub fn at_path(path: PathBuf, cap_bytes: u64) -> Self
A ledger at an explicit path with an explicit cap — the test constructor (the bound assertion drives a tiny cap).
Sourcepub fn record(
&self,
surface: &str,
verb: &str,
code: &str,
reason: Option<&'static str>,
)
pub fn record( &self, surface: &str, verb: &str, code: &str, reason: Option<&'static str>, )
Append one refusal. Best-effort by contract: every failure —
unwritable dir, full disk, rename race — is swallowed, and the
caller’s refusal path proceeds unchanged. Records only values
from closed engine-defined vocabularies (module hard line);
reason is &'static str by design — the only way to pass one
is an engine-source literal, normally closed_reason’s
return. A refusal whose reason cannot be determined records
with None rather than not recording.
Sourcepub fn total_bytes(&self) -> u64
pub fn total_bytes(&self) -> u64
Total bytes currently on disk across both generations — the observable the bound test asserts against.
Sourcepub fn entries(&self) -> Vec<FrictionEntry>
pub fn entries(&self) -> Vec<FrictionEntry>
Read every parseable entry across both generations, oldest generation first. Unparseable lines are skipped (the summary is tolerant; the concurrency test asserts none exist).
Trait Implementations§
Source§impl Clone for FrictionLedger
impl Clone for FrictionLedger
Source§fn clone(&self) -> FrictionLedger
fn clone(&self) -> FrictionLedger
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for FrictionLedger
impl RefUnwindSafe for FrictionLedger
impl Send for FrictionLedger
impl Sync for FrictionLedger
impl Unpin for FrictionLedger
impl UnsafeUnpin for FrictionLedger
impl UnwindSafe for FrictionLedger
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more