pub struct Annotation {
pub id: String,
pub annotation_type: AnnotationType,
pub anchor: ContentAnchor,
pub author: String,
pub created: String,
pub content: String,
}Available on crate feature
signatures only.Expand description
A core annotation.
Core annotations are simpler than collaboration comments - they use a plain
string author field instead of the full Collaborator object, and don’t
support threading, suggestions, or reactions.
Fields§
§id: StringUnique annotation identifier.
annotation_type: AnnotationTypeAnnotation type.
anchor: ContentAnchorAnchor to document content.
Author name or identifier.
created: StringISO 8601 creation timestamp.
content: StringAnnotation content (text).
Implementations§
Source§impl Annotation
impl Annotation
Sourcepub fn new(
id: impl Into<String>,
annotation_type: AnnotationType,
anchor: ContentAnchor,
author: impl Into<String>,
content: impl Into<String>,
) -> Self
pub fn new( id: impl Into<String>, annotation_type: AnnotationType, anchor: ContentAnchor, author: impl Into<String>, content: impl Into<String>, ) -> Self
Create a new annotation.
Sourcepub fn comment(
id: impl Into<String>,
anchor: ContentAnchor,
author: impl Into<String>,
content: impl Into<String>,
) -> Self
pub fn comment( id: impl Into<String>, anchor: ContentAnchor, author: impl Into<String>, content: impl Into<String>, ) -> Self
Create a comment annotation.
Sourcepub fn highlight(
id: impl Into<String>,
anchor: ContentAnchor,
author: impl Into<String>,
content: impl Into<String>,
) -> Self
pub fn highlight( id: impl Into<String>, anchor: ContentAnchor, author: impl Into<String>, content: impl Into<String>, ) -> Self
Create a highlight annotation.
Sourcepub fn note(
id: impl Into<String>,
anchor: ContentAnchor,
author: impl Into<String>,
content: impl Into<String>,
) -> Self
pub fn note( id: impl Into<String>, anchor: ContentAnchor, author: impl Into<String>, content: impl Into<String>, ) -> Self
Create a note annotation.
Sourcepub fn reaction(
id: impl Into<String>,
anchor: ContentAnchor,
author: impl Into<String>,
emoji: impl Into<String>,
) -> Self
pub fn reaction( id: impl Into<String>, anchor: ContentAnchor, author: impl Into<String>, emoji: impl Into<String>, ) -> Self
Create a reaction annotation.
Sourcepub fn with_created(self, created: impl Into<String>) -> Self
pub fn with_created(self, created: impl Into<String>) -> Self
Set the creation timestamp.
Trait Implementations§
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<'de> Deserialize<'de> for Annotation
impl<'de> Deserialize<'de> for Annotation
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
Source§impl PartialEq for Annotation
impl PartialEq for Annotation
Source§impl Serialize for Annotation
impl Serialize for Annotation
impl Eq for Annotation
impl StructuralPartialEq 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 UnsafeUnpin 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> 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.