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 fully 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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Annotations
impl Debug for Annotations
Source§impl Default for Annotations
impl Default for Annotations
Source§fn default() -> Annotations
fn default() -> Annotations
Source§impl<'de> Deserialize<'de> for Annotations
impl<'de> Deserialize<'de> for Annotations
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 Annotations
impl PartialEq for Annotations
Source§fn eq(&self, other: &Annotations) -> bool
fn eq(&self, other: &Annotations) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for Annotations
impl Serialize for Annotations
impl StructuralPartialEq for Annotations
Auto Trait Implementations§
impl Freeze for Annotations
impl RefUnwindSafe for Annotations
impl Send for Annotations
impl Sync for Annotations
impl Unpin for Annotations
impl UnsafeUnpin for Annotations
impl UnwindSafe for Annotations
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].