pub struct AnnotationManager { /* private fields */ }Expand description
Manager for annotations.
Implementations§
Source§impl AnnotationManager
impl AnnotationManager
pub fn new() -> Self
Sourcepub fn add(&mut self, annotation: Annotation)
pub fn add(&mut self, annotation: Annotation)
Add an annotation entry.
Sourcepub fn create_highlight(
&mut self,
cfi_range: &str,
color: &str,
selected_text: Option<&str>,
note: Option<&str>,
) -> Annotation
pub fn create_highlight( &mut self, cfi_range: &str, color: &str, selected_text: Option<&str>, note: Option<&str>, ) -> Annotation
Create a highlight annotation.
Sourcepub fn create_bookmark(&mut self, cfi: &str, note: Option<&str>) -> Annotation
pub fn create_bookmark(&mut self, cfi: &str, note: Option<&str>) -> Annotation
Create a bookmark annotation.
Sourcepub fn get(&self, id: &str) -> Option<&Annotation>
pub fn get(&self, id: &str) -> Option<&Annotation>
Get annotation by ID.
Sourcepub fn list(&self) -> Vec<Annotation>
pub fn list(&self) -> Vec<Annotation>
List all annotations.
Sourcepub fn to_w3c_json(&self) -> Result<String, String>
pub fn to_w3c_json(&self) -> Result<String, String>
Export annotations as W3C Web Annotation Data Model (JSON-LD) format (F10 Fix).
Trait Implementations§
Source§impl Clone for AnnotationManager
impl Clone for AnnotationManager
Source§fn clone(&self) -> AnnotationManager
fn clone(&self) -> AnnotationManager
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 AnnotationManager
impl Debug for AnnotationManager
Source§impl Default for AnnotationManager
impl Default for AnnotationManager
Source§fn default() -> AnnotationManager
fn default() -> AnnotationManager
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AnnotationManager
impl<'de> Deserialize<'de> for AnnotationManager
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AnnotationManager
impl RefUnwindSafe for AnnotationManager
impl Send for AnnotationManager
impl Sync for AnnotationManager
impl Unpin for AnnotationManager
impl UnsafeUnpin for AnnotationManager
impl UnwindSafe for AnnotationManager
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
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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