pub struct Annotation {
pub body: String,
pub style: AnnotationStyle,
pub notes: String,
pub tags: BTreeSet<String>,
pub metadata: AnnotationMetadata,
}
Expand description
A struct representing an annotation and its metadata.
Fields§
§body: String
The body of the annotation.
style: AnnotationStyle
The annotation’s highlight style.
notes: String
The annotation’s notes.
The annotation’s #tags
.
metadata: AnnotationMetadata
The annotation’s metadata.
Trait Implementations§
Source§impl ABQuery for Annotation
impl ABQuery for Annotation
Source§const QUERY: &'static str = {
"SELECT\n ZANNOTATIONSELECTEDTEXT, -- 0 body\n ZANNOTATIONNOTE, -- 1 notes\n ZANNOTATIONSTYLE, -- 2 style\n ZANNOTATIONUUID, -- 3 id\n ZAEANNOTATION.ZANNOTATIONASSETID, -- 4 book_id\n ZANNOTATIONCREATIONDATE, -- 5 created\n ZANNOTATIONMODIFICATIONDATE, -- 6 modified\n ZANNOTATIONLOCATION -- 7 location\n FROM ZAEANNOTATION\n WHERE ZANNOTATIONSELECTEDTEXT IS NOT NULL\n AND ZANNOTATIONDELETED = 0\n ORDER BY ZANNOTATIONASSETID;"
}
const QUERY: &'static str = { "SELECT\n ZANNOTATIONSELECTEDTEXT, -- 0 body\n ZANNOTATIONNOTE, -- 1 notes\n ZANNOTATIONSTYLE, -- 2 style\n ZANNOTATIONUUID, -- 3 id\n ZAEANNOTATION.ZANNOTATIONASSETID, -- 4 book_id\n ZANNOTATIONCREATIONDATE, -- 5 created\n ZANNOTATIONMODIFICATIONDATE, -- 6 modified\n ZANNOTATIONLOCATION -- 7 location\n FROM ZAEANNOTATION\n WHERE ZANNOTATIONSELECTEDTEXT IS NOT NULL\n AND ZANNOTATIONDELETED = 0\n ORDER BY ZANNOTATIONASSETID;" }
The query to retrieve rows from the database. The rows are then passed
into
ABQuery::from_row()
to create instances of the implementing
type.Source§fn from_row(row: &Row<'_>) -> Self
fn from_row(row: &Row<'_>) -> Self
Constructs an instance of the implementing type from a
rusqlite::Row
.Source§impl Clone for Annotation
impl Clone for Annotation
Source§fn clone(&self) -> Annotation
fn clone(&self) -> Annotation
Returns a duplicate of the value. Read more
1.0.0 · 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 Annotation
impl Debug for Annotation
Source§impl Default for Annotation
impl Default for Annotation
Source§fn default() -> Annotation
fn default() -> Annotation
Returns the “default value” for a type. Read more
Source§impl<'a> From<&'a Annotation> for AnnotationContext<'a>
impl<'a> From<&'a Annotation> for AnnotationContext<'a>
Source§fn from(annotation: &'a Annotation) -> Self
fn from(annotation: &'a Annotation) -> Self
Converts to this type from the input type.
Source§impl From<AnnotationRaw> for Annotation
impl From<AnnotationRaw> for Annotation
Source§fn from(annotation: AnnotationRaw) -> Self
fn from(annotation: AnnotationRaw) -> Self
Converts to this type from the input type.
Source§impl Ord for Annotation
impl Ord for Annotation
Source§impl PartialEq for Annotation
impl PartialEq for Annotation
Source§impl PartialOrd for Annotation
impl PartialOrd for Annotation
Source§impl Serialize for Annotation
impl Serialize for Annotation
impl Eq for Annotation
Auto Trait Implementations§
impl Freeze for Annotation
impl RefUnwindSafe for Annotation
impl Send for Annotation
impl Sync for Annotation
impl Unpin for Annotation
impl UnwindSafe for Annotation
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> 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