pub struct NoteDetails {
pub path: VaultPath,
pub raw_text: String,
}Expand description
A note’s vault path paired with its raw, unprocessed text.
This is the entry point for whole-note content extraction: title, hash,
heading chunks, and links are all derived on demand from raw_text via
the methods below — nothing is precomputed or cached here. The struct
performs no I/O; the caller is responsible for loading the text.
Fields§
§path: VaultPathVault-internal path of the note, flattened on construction.
raw_text: StringThe note’s verbatim Markdown source, including any frontmatter.
Implementations§
Source§impl NoteDetails
The one door to whole-note extraction. The borrowed-text associated
functions (*_of) exist for bulk paths (indexing) that hold many notes’
text as &str and must not clone it; the get_* methods are the same
operations over this note’s owned text.
impl NoteDetails
The one door to whole-note extraction. The borrowed-text associated
functions (*_of) exist for bulk paths (indexing) that hold many notes’
text as &str and must not clone it; the get_* methods are the same
operations over this note’s owned text.
Sourcepub fn new<S: AsRef<str>>(note_path: &VaultPath, text: S) -> Self
pub fn new<S: AsRef<str>>(note_path: &VaultPath, text: S) -> Self
Builds a NoteDetails from a vault path and the note’s raw text.
The path is flattened (./.. segments resolved) on the way in; the
text is copied into the owned raw_text field unchanged.
Sourcepub fn get_title_from_text<S: AsRef<str>>(text: S) -> String
pub fn get_title_from_text<S: AsRef<str>>(text: S) -> String
Title of a note body, without constructing a NoteDetails.
Sourcepub fn content_data_of<S: AsRef<str>>(text: S) -> NoteContentData
pub fn content_data_of<S: AsRef<str>>(text: S) -> NoteContentData
Indexable content data (title + hash) of a note body, without
constructing a NoteDetails.
Sourcepub fn content_chunks_of<S: AsRef<str>>(text: S) -> Vec<ContentChunk>
pub fn content_chunks_of<S: AsRef<str>>(text: S) -> Vec<ContentChunk>
Heading-chunked content of a note body, without constructing a
NoteDetails.
Sourcepub fn chunks_and_links_of<S: AsRef<str>>(
path: &VaultPath,
text: S,
) -> (Vec<ContentChunk>, Vec<NoteLink>)
pub fn chunks_and_links_of<S: AsRef<str>>( path: &VaultPath, text: S, ) -> (Vec<ContentChunk>, Vec<NoteLink>)
Heading chunks plus every link (note links, attachments, images,
URLs, hashtags) of a note body at path, without constructing a
NoteDetails.
Sourcepub fn get_title(&self) -> String
pub fn get_title(&self) -> String
Title of this note (first non-empty line of the body, frontmatter skipped).
Sourcepub fn get_content_data(&self) -> NoteContentData
pub fn get_content_data(&self) -> NoteContentData
Indexable content data (title + content hash) of this note.
Sourcepub fn get_content_chunks(&self) -> Vec<ContentChunk>
pub fn get_content_chunks(&self) -> Vec<ContentChunk>
Heading-chunked content of this note, one ContentChunk per
heading section.
Sourcepub fn get_chunks_and_links(&self) -> (Vec<ContentChunk>, Vec<NoteLink>)
pub fn get_chunks_and_links(&self) -> (Vec<ContentChunk>, Vec<NoteLink>)
Heading chunks plus every link (note links, attachments, images,
URLs, hashtags) of this note, resolved against its own path.
Sourcepub fn get_markdown_and_links(&self) -> (String, Vec<NoteLink>)
pub fn get_markdown_and_links(&self) -> (String, Vec<NoteLink>)
Rendered Markdown of this note plus its extracted links: wikilinks
become standard Markdown links, note links resolve to vault-relative
absolute paths, hashtags become [#tag](#tag) links.
Trait Implementations§
Source§impl Clone for NoteDetails
impl Clone for NoteDetails
Source§fn clone(&self) -> NoteDetails
fn clone(&self) -> NoteDetails
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NoteDetails
impl Debug for NoteDetails
Source§impl Display for NoteDetails
impl Display for NoteDetails
impl Eq for NoteDetails
Source§impl PartialEq for NoteDetails
impl PartialEq for NoteDetails
impl StructuralPartialEq for NoteDetails
Auto Trait Implementations§
impl Freeze for NoteDetails
impl RefUnwindSafe for NoteDetails
impl Send for NoteDetails
impl Sync for NoteDetails
impl Unpin for NoteDetails
impl UnsafeUnpin for NoteDetails
impl UnwindSafe for NoteDetails
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
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
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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>
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 more