pub struct MemoryWrite {
pub id: String,
pub subject: String,
pub purpose: String,
pub expires_at: Option<Timestamp>,
pub access_retention_seconds: Option<u64>,
}Expand description
Where a runtime memory write lands.
Security metadata is intentionally absent. StepCtx::remember derives
trust, provenance and sensitivity from the Tainted<Value> being stored, so
an untrusted model result cannot be promoted by constructing metadata that
says otherwise.
Fields§
§id: String§subject: String§purpose: String§expires_at: Option<Timestamp>§access_retention_seconds: Option<u64>Implementations§
Source§impl MemoryWrite
impl MemoryWrite
pub fn new( id: impl Into<String>, subject: impl Into<String>, purpose: impl Into<String>, ) -> Self
Sourcepub const fn expires_at(self, at: Timestamp) -> Self
pub const fn expires_at(self, at: Timestamp) -> Self
Expire this memory from fresh recall at a deterministic instant.
A hard ceiling: a sliding window set beside it may collect the memory earlier, and no touch carries it past this.
Sourcepub const fn retain_after_access(self, seconds: u64) -> Self
pub const fn retain_after_access(self, seconds: u64) -> Self
Keep the memory for this long after each explicitly journaled recall.
The window opens at the write itself, so an untouched memory is
collected seconds after it was stored rather than kept forever
waiting for a first touch — and it never extends past an expires_at
set beside it.
Trait Implementations§
Source§impl Clone for MemoryWrite
impl Clone for MemoryWrite
Source§fn clone(&self) -> MemoryWrite
fn clone(&self) -> MemoryWrite
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MemoryWrite
impl Debug for MemoryWrite
impl Eq for MemoryWrite
Source§impl PartialEq for MemoryWrite
impl PartialEq for MemoryWrite
impl StructuralPartialEq for MemoryWrite
Auto Trait Implementations§
impl Freeze for MemoryWrite
impl RefUnwindSafe for MemoryWrite
impl Send for MemoryWrite
impl Sync for MemoryWrite
impl Unpin for MemoryWrite
impl UnsafeUnpin for MemoryWrite
impl UnwindSafe for MemoryWrite
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> ⓘ
Converts
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> ⓘ
Converts
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 moreCreates a shared type from an unshared type.