pub struct Annotation {
pub id: String,
pub turn_id: String,
pub resource: Uri,
pub range: Option<TextRange>,
pub resolved: bool,
pub entries: Vec<AnnotationEntry>,
pub meta: Option<JsonObject>,
}Expand description
A conversation anchored to a specific file produced by a specific turn, optionally narrowed to a range within that file.
{@link turnId} anchors the annotation to the file versions that turn produced, so a later turn that rewrites the same file does not silently invalidate the annotation’s anchor — clients can resolve {@link resource} and {@link range} against the turn’s changeset. When {@link range} is omitted the annotation is anchored to the entire file.
Every annotation MUST contain at least one {@link AnnotationEntry}. An {@link AnnotationsSetAction} that creates an annotation therefore carries its mandatory first entry, and removing the last remaining entry collapses the annotation via {@link AnnotationsRemovedAction} rather than leaving an empty annotation behind.
Fields§
§id: StringStable identifier within the annotations channel. Assigned by the client that dispatches the creating {@link AnnotationsSetAction}.
turn_id: StringTurn that produced the file versions this annotation is anchored to. Matches a {@link Turn.id} on the owning session.
resource: UriThe file the annotation is anchored to.
range: Option<TextRange>Range within {@link resource} the annotation is anchored to. When omitted the annotation is anchored to the entire file.
resolved: boolWhether the annotation has been resolved. Newly created annotations are
always unresolved (false); a client marks an annotation resolved (or
re-opens it) by dispatching an {@link AnnotationsUpdatedAction} carrying
the updated flag (or an {@link AnnotationsSetAction} when replacing the
whole annotation).
entries: Vec<AnnotationEntry>Entries in this annotation, in dispatch order (oldest first). MUST contain at least one entry.
meta: Option<JsonObject>Producer-defined opaque metadata, surfaced to tooling but not interpreted by the protocol.
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 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>,
Source§impl PartialEq for Annotation
impl PartialEq for Annotation
Source§fn eq(&self, other: &Annotation) -> bool
fn eq(&self, other: &Annotation) -> bool
self and other values to be equal, and is used by ==.