pub struct NoteContentData {
pub title: String,
pub hash: u64,
}Expand description
NoteContentData contains the basic extracted data from the note for comparison and search in the DB, it is expensive to get so it is not a good idea to calculate it every time the content has changed, but better lazy get it when needed and cache it somewhere (like the DB) for search and access.
Fields§
§title: StringThe note’s title (first non-empty body line, frontmatter skipped).
hash: u64XxHash64 digest of the note’s full text, used to detect content changes cheaply during indexing.
Implementations§
Source§impl NoteContentData
impl NoteContentData
Sourcepub fn new(title: String, hash: u64) -> Self
pub fn new(title: String, hash: u64) -> Self
Builds a NoteContentData from a precomputed title and content
hash.
Trait Implementations§
Source§impl Clone for NoteContentData
impl Clone for NoteContentData
Source§fn clone(&self) -> NoteContentData
fn clone(&self) -> NoteContentData
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NoteContentData
impl Debug for NoteContentData
Source§impl Display for NoteContentData
impl Display for NoteContentData
impl Eq for NoteContentData
Source§impl PartialEq for NoteContentData
impl PartialEq for NoteContentData
Source§fn eq(&self, other: &NoteContentData) -> bool
fn eq(&self, other: &NoteContentData) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for NoteContentData
impl Serialize for NoteContentData
impl StructuralPartialEq for NoteContentData
Auto Trait Implementations§
impl Freeze for NoteContentData
impl RefUnwindSafe for NoteContentData
impl Send for NoteContentData
impl Sync for NoteContentData
impl Unpin for NoteContentData
impl UnsafeUnpin for NoteContentData
impl UnwindSafe for NoteContentData
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
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
Compare self to
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>
Converts
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>
Converts
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