Skip to main content

Note

Struct Note 

Source
pub struct Note {
    pub header: Header,
    pub kind: String,
    pub status: NoteStatus,
    pub content: String,
    pub properties: BTreeMap<String, PropertyValue>,
    pub tags: Vec<String>,
    pub salience: Option<f64>,
    pub decay_factor: Option<f64>,
    pub expires_at: Option<Timestamp>,
    pub deleted_at: Option<Timestamp>,
}
Expand description

A note record — temporal-referential content plus free-form properties.

When present, salience must be finite and in [0.0, 1.0], and decay_factor must be finite and non-negative. When the serde feature is enabled, deserialization rejects out-of-range values.

Fields§

§header: Header

Identity and namespace metadata shared by all substrate records.

§kind: String

Pack-declared kind string (e.g. "observation", "task", "memory").

§status: NoteStatus

Cross-cutting lifecycle status.

§content: String

Main textual body of the note.

§properties: BTreeMap<String, PropertyValue>

Arbitrary structured metadata as key-value pairs.

§tags: Vec<String>

Categorical labels for filtering and retrieval.

§salience: Option<f64>

Retrieval priority weight in [0.0, 1.0]; higher values surface the note sooner.

§decay_factor: Option<f64>

Exponential decay rate applied to salience over time; 0.0 means no decay.

§expires_at: Option<Timestamp>

Optional expiry timestamp after which the note is treated as inactive.

§deleted_at: Option<Timestamp>

Set when the note is soft-deleted; absent means active.

Implementations§

Source§

impl Note

Source

pub fn is_valid(&self) -> bool

Return true if all numeric fields carry finite, domain-valid values.

  • salience, if present, must be finite and in [0.0, 1.0].
  • decay_factor, if present, must be finite and non-negative.

Trait Implementations§

Source§

impl Clone for Note

Source§

fn clone(&self) -> Note

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 Note

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Note

§

impl RefUnwindSafe for Note

§

impl Send for Note

§

impl Sync for Note

§

impl Unpin for Note

§

impl UnsafeUnpin for Note

§

impl UnwindSafe for Note

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> 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> 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.