pub struct Annotation {
pub id: AnnotationId,
pub parent_id: Option<AnnotationId>,
pub paper_id: PaperId,
pub question_id: Option<QuestionId>,
pub anchor: Anchor,
pub note: String,
pub color: Option<String>,
pub tags: Vec<String>,
pub author: String,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub deleted_at: Option<DateTime<Utc>>,
}Expand description
One annotation. May be a root (with an anchor) or a reply (parent_id set, anchor empty; the root’s anchor is the canonical one for rendering).
Fields§
§id: AnnotationId§parent_id: Option<AnnotationId>None = root (carries the anchor). Some = reply to that ID.
paper_id: PaperId§question_id: Option<QuestionId>§anchor: Anchor§note: String§color: Option<String>Identity string — $USER for TUI writes, required for MCP writes.
created_at: DateTime<Utc>§updated_at: DateTime<Utc>§deleted_at: Option<DateTime<Utc>>Soft-delete tombstone. None = live.
Implementations§
Source§impl Annotation
impl Annotation
Sourcepub fn new_root(
paper_id: PaperId,
author: String,
note: String,
anchor: Anchor,
) -> Self
pub fn new_root( paper_id: PaperId, author: String, note: String, anchor: Anchor, ) -> Self
Build a new root-level annotation with the given anchor.
Sourcepub fn new_reply(parent: &Annotation, author: String, note: String) -> Self
pub fn new_reply(parent: &Annotation, author: String, note: String) -> Self
Build a new reply whose anchor is empty (inherits from root).
Sourcepub fn is_deleted(&self) -> bool
pub fn is_deleted(&self) -> bool
True if this annotation has been soft-deleted.
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 (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 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
impl Eq for Annotation
Source§impl PartialEq for Annotation
impl PartialEq for Annotation
Source§fn eq(&self, other: &Annotation) -> bool
fn eq(&self, other: &Annotation) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for Annotation
impl Serialize 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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.