pub struct Annotation {
pub annotation_id: String,
pub scope: AnnotationScope,
pub status: AnnotationStatus,
pub revisions: Vec<AnnotationRevision>,
pub supersedes_annotation_id: Option<String>,
pub supersedes_rewrite_pct: Option<u32>,
pub visibility: VisibilityTier,
pub resolved_from_discussion: Option<String>,
}Expand description
A stable logical annotation with revision history.
Fields§
§annotation_id: String§scope: AnnotationScope§status: AnnotationStatus§revisions: Vec<AnnotationRevision>§supersedes_annotation_id: Option<String>§supersedes_rewrite_pct: Option<u32>§visibility: VisibilityTierVisibility scope. Pre-W1 annotations have no field on disk; rmp-serde
fills the default (VisibilityTier::Public), preserving the
pre-existing meaning (“annotations are publicly visible”).
resolved_from_discussion: Option<String>Back-pointer set when this annotation was produced by resolving a discussion. Lets viewers jump from the annotation back to the discussion that produced it.
Implementations§
Source§impl Annotation
impl Annotation
pub fn new( scope: AnnotationScope, kind: AnnotationKind, content: String, tags: Vec<String>, attribution: String, created_at: i64, source_hash: Option<ContentHash>, created_at_state: Option<ChangeId>, ) -> Self
pub fn current_revision(&self) -> Option<&AnnotationRevision>
pub fn current_revision_mut(&mut self) -> Option<&mut AnnotationRevision>
pub fn revise( &mut self, kind: AnnotationKind, content: String, tags: Vec<String>, attribution: String, created_at: i64, source_hash: Option<ContentHash>, created_at_state: Option<ChangeId>, ) -> &AnnotationRevision
pub fn mark_superseded(&mut self)
pub fn validate(&self) -> Result<(), ContextError>
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