Skip to main content

RecallOptions

Struct RecallOptions 

Source
pub struct RecallOptions<'a> {
    pub scope: Option<&'a str>,
    pub kind: Option<MemoryKind>,
    pub anchor_key: Option<&'a str>,
    pub query: Option<&'a str>,
    pub decay: Decay,
    pub applicable_only: bool,
    pub limit: Option<usize>,
}
Expand description

How to recall.

RecallOptions::default is every live record, ranked, with no age term — the reproducible answer.

Fields§

§scope: Option<&'a str>

Only records recorded in this namespace, matched exactly.

§kind: Option<MemoryKind>

Only records of this kind.

§anchor_key: Option<&'a str>

Only records anchored to this node key.

§query: Option<&'a str>

Every whitespace-separated token must appear in the record’s body, its anchor key or its anchor path (case-insensitively). A filter, not a scorer: the ranking formula has no lexical term, so which records come back can depend on the query while how they are ranked cannot.

§decay: Decay

How age is priced in. Defaults to Decay::None — reproducible recall.

§applicable_only: bool

Drop records that do not apply to this tree. Off by default: an unanchored or drifted record is demoted and labelled, not withheld, and a lesson about deleted code is often the one worth reading.

§limit: Option<usize>

At most this many records, applied after ranking so a limit returns the best matches rather than the newest ones.

None and Some(0) are the same request: every record. 0 is unlimited here because window is the one place that decides what limit means in this crate, and that is what it decides (issue #375). Recall used to read Some(0) as no records — the third implementation of one parameter that window’s doc warned about, and issue #447.

Trait Implementations§

Source§

impl<'a> Clone for RecallOptions<'a>

Source§

fn clone(&self) -> RecallOptions<'a>

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<'a> Copy for RecallOptions<'a>

Source§

impl<'a> Debug for RecallOptions<'a>

Source§

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

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

impl<'a> Default for RecallOptions<'a>

Source§

fn default() -> RecallOptions<'a>

Returns the “default value” for a type. Read more
Source§

impl<'a> Eq for RecallOptions<'a>

Source§

impl<'a> PartialEq for RecallOptions<'a>

Source§

fn eq(&self, other: &RecallOptions<'a>) -> bool

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

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

Inequality operator !=. Read more
Source§

impl<'a> StructuralPartialEq for RecallOptions<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for RecallOptions<'a>

§

impl<'a> RefUnwindSafe for RecallOptions<'a>

§

impl<'a> Send for RecallOptions<'a>

§

impl<'a> Sync for RecallOptions<'a>

§

impl<'a> Unpin for RecallOptions<'a>

§

impl<'a> UnsafeUnpin for RecallOptions<'a>

§

impl<'a> UnwindSafe for RecallOptions<'a>

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> 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.