pub struct Annotations {
pub audience: Option<Vec<Role>>,
pub priority: Option<f64>,
pub last_modified: Option<String>,
pub danger: Option<DangerLevel>,
pub destructive: Option<bool>,
pub read_only: Option<bool>,
}
Expand description
Optional annotations for the client. The client can use annotations to inform how objects are used or displayed.
Fields§
§audience: Option<Vec<Role>>
Describes who the intended customer of this object or data is.
It can include multiple entries to indicate content useful for multiple audiences (e.g., ["user", "assistant"]
).
priority: Option<f64>
Describes how important this data is for operating the server.
A value of 1 means “most important,” and indicates that the data is effectively required, while 0 means “least important,” and indicates that the data is entirely optional.
last_modified: Option<String>
The moment the resource was last modified, as an ISO 8601 formatted string.
Should be an ISO 8601 formatted string (e.g., “2025-01-12T15:00:58Z”).
Examples: last activity timestamp in an open file, timestamp when the resource was attached, etc.
danger: Option<DangerLevel>
Legacy danger level field for test compatibility
destructive: Option<bool>
Legacy destructive field for test compatibility
read_only: Option<bool>
Legacy read_only field for test compatibility
Implementations§
Source§impl Annotations
impl Annotations
Sourcepub fn with_priority(self, priority: f64) -> Self
pub fn with_priority(self, priority: f64) -> Self
Set priority (0.0 = least important, 1.0 = most important)
Sourcepub fn for_audience(self, audience: Vec<Role>) -> Self
pub fn for_audience(self, audience: Vec<Role>) -> Self
Set audience
Sourcepub fn with_last_modified<S: Into<String>>(self, timestamp: S) -> Self
pub fn with_last_modified<S: Into<String>>(self, timestamp: S) -> Self
Set last modified timestamp (ISO 8601 format)
Sourcepub fn for_audience_legacy(self, _audience: Vec<AnnotationAudience>) -> Self
pub fn for_audience_legacy(self, _audience: Vec<AnnotationAudience>) -> Self
Set audience (legacy compatibility)
Sourcepub fn with_danger_level(self, _level: DangerLevel) -> Self
pub fn with_danger_level(self, _level: DangerLevel) -> Self
Set danger level (legacy compatibility)
Sourcepub fn danger(&self) -> Option<DangerLevel>
pub fn danger(&self) -> Option<DangerLevel>
Legacy danger field (always returns None for compatibility)
Sourcepub fn audience(&self) -> Option<Vec<AnnotationAudience>>
pub fn audience(&self) -> Option<Vec<AnnotationAudience>>
Legacy audience field (always returns None for compatibility)
Sourcepub fn destructive(self, level: DangerLevel) -> Self
pub fn destructive(self, level: DangerLevel) -> Self
Set as destructive (legacy compatibility)
Trait Implementations§
Source§impl Clone for Annotations
impl Clone for Annotations
Source§fn clone(&self) -> Annotations
fn clone(&self) -> Annotations
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more