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>,
pub anchor_status: AnnotationAnchorStatus,
pub divergent_revision_ids: Vec<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.
anchor_status: AnnotationAnchorStatusMaterialized health of the annotation’s file anchor. Lifecycle status remains separate: an active annotation can need anchor attention.
divergent_revision_ids: Vec<String>Live revision tips when concurrent edits have not been resolved. Empty means the last revision is the sole current revision.
Implementations§
Source§impl Annotation
impl Annotation
Sourcepub fn new(
scope: AnnotationScope,
kind: AnnotationKind,
content: String,
tags: Vec<String>,
attribution: String,
created_at: i64,
source_hash: Option<ContentHash>,
created_at_state: Option<StateId>,
visibility: VisibilityTier,
) -> 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<StateId>, visibility: VisibilityTier, ) -> Annotation
Create an annotation with an explicit audience. Derived annotations must carry their source visibility rather than choosing a creation default.
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<StateId>, ) -> &AnnotationRevision
pub fn mark_superseded(&mut self)
pub fn validate(&self) -> Result<(), ContextError>
pub fn current_revision_ids(&self) -> Vec<&str>
Trait Implementations§
Source§impl Clone for Annotation
impl Clone for Annotation
Source§fn clone(&self) -> Annotation
fn clone(&self) -> Annotation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more