pub struct AnnotationsFile {
pub version: Option<String>,
pub annotations: Vec<Annotation>,
}Available on crate feature
signatures only.Expand description
Core annotations file for security/annotations.json.
Provides minimal annotation support for implementations that don’t use the collaboration extension.
Fields§
§version: Option<String>Format version (e.g., “0.1”).
annotations: Vec<Annotation>Array of annotations.
Implementations§
Source§impl AnnotationsFile
impl AnnotationsFile
Sourcepub fn new(annotations: Vec<Annotation>) -> Self
pub fn new(annotations: Vec<Annotation>) -> Self
Create a new annotations file.
Sourcepub fn add(&mut self, annotation: Annotation)
pub fn add(&mut self, annotation: Annotation)
Add an annotation.
Sourcepub fn get(&self, id: &str) -> Option<&Annotation>
pub fn get(&self, id: &str) -> Option<&Annotation>
Get an annotation by ID.
Sourcepub fn for_block(&self, block_id: &str) -> Vec<&Annotation>
pub fn for_block(&self, block_id: &str) -> Vec<&Annotation>
Get all annotations for a specific block.
Trait Implementations§
Source§impl Clone for AnnotationsFile
impl Clone for AnnotationsFile
Source§fn clone(&self) -> AnnotationsFile
fn clone(&self) -> AnnotationsFile
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 AnnotationsFile
impl Debug for AnnotationsFile
Source§impl Default for AnnotationsFile
impl Default for AnnotationsFile
Source§impl<'de> Deserialize<'de> for AnnotationsFile
impl<'de> Deserialize<'de> for AnnotationsFile
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 AnnotationsFile
impl PartialEq for AnnotationsFile
Source§impl Serialize for AnnotationsFile
impl Serialize for AnnotationsFile
impl Eq for AnnotationsFile
impl StructuralPartialEq for AnnotationsFile
Auto Trait Implementations§
impl Freeze for AnnotationsFile
impl RefUnwindSafe for AnnotationsFile
impl Send for AnnotationsFile
impl Sync for AnnotationsFile
impl Unpin for AnnotationsFile
impl UnsafeUnpin for AnnotationsFile
impl UnwindSafe for AnnotationsFile
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.