pub struct MemoryEntry {
pub name: String,
pub description: String,
pub content: String,
pub path: PathBuf,
}Expand description
A single memory entry.
Fields§
§name: String§description: String§content: String§path: PathBufImplementations§
Source§impl MemoryEntry
impl MemoryEntry
Sourcepub fn new(
name: String,
description: String,
content: String,
entries_dir: &Path,
) -> Self
pub fn new( name: String, description: String, content: String, entries_dir: &Path, ) -> Self
Create a new entry with a computed path under entries_dir.
Sourcepub fn parse(path: PathBuf, raw: &str) -> Result<Self>
pub fn parse(path: PathBuf, raw: &str) -> Result<Self>
Parse an entry from its file content and path.
Sourcepub fn search_text(&self) -> String
pub fn search_text(&self) -> String
Text for BM25 scoring — description + content concatenated.
Auto Trait Implementations§
impl Freeze for MemoryEntry
impl RefUnwindSafe for MemoryEntry
impl Send for MemoryEntry
impl Sync for MemoryEntry
impl Unpin for MemoryEntry
impl UnsafeUnpin for MemoryEntry
impl UnwindSafe for MemoryEntry
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