Skip to main content

MemoryRecord

Struct MemoryRecord 

Source
pub struct MemoryRecord {
    pub id: i64,
    pub scope: String,
    pub kind: MemoryKind,
    pub anchor: Option<MemoryAnchor>,
    pub anchor_state: AnchorState,
    pub applies: bool,
    pub body: String,
    pub confidence: Option<f64>,
    pub tree: Option<String>,
    pub created_at: String,
    pub superseded_by: Option<i64>,
    pub superseded_at: Option<String>,
}
Expand description

One stored memory record.

Fields§

§id: i64

The monotonic generation and identity. AUTOINCREMENT, so an id is never reused after a crate::Store::forget_memory.

§scope: String

The recorded namespace — which repo or project this belongs to. Not a branch label; see DEFAULT_MEMORY_SCOPE.

§kind: MemoryKind

What kind of knowledge this is.

§anchor: Option<MemoryAnchor>

Where it is anchored, if anywhere.

§anchor_state: AnchorState

What that anchor is worth against the current graph. Computed on read; no column holds it.

§applies: bool

Whether this record applies to the tree it was just read againstAnchorState::applies for the state above, surfaced as its own field so a programmatic consumer gets the scope rule without having to re-implement it from the state token.

Like anchor_state, computed on every read and stored in no column. A false here is never a reason to delete anything: the record still applies wherever its anchor does resolve.

§body: String

The prose. Unredacted by construction — see the module docs on privacy.

§confidence: Option<f64>

The writer’s own confidence, when it offered one. Not the score an inferred edge carries, and never readable as one: no memory record is a graph fact.

§tree: Option<String>

The sync_state tree id when the record was written — the repo-state witness, so a reader can tell which state of the world the writer saw.

§created_at: String

SQLite’s datetime('now') at write time. Written for humans and never read, exactly as imports.imported_at is; no ordering or policy depends on it.

§superseded_by: Option<i64>

The record that overruled this one, if any. Live listing excludes any record with a successor, immediately and regardless of age.

§superseded_at: Option<String>

When that happened. Display only, on the same terms as created_at.

Implementations§

Source§

impl MemoryRecord

Source

pub fn is_live(&self) -> bool

Whether this record is live — nothing has superseded it.

Trait Implementations§

Source§

impl Clone for MemoryRecord

Source§

fn clone(&self) -> MemoryRecord

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MemoryRecord

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for MemoryRecord

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for MemoryRecord

Source§

fn eq(&self, other: &MemoryRecord) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for MemoryRecord

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for MemoryRecord

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.