#[non_exhaustive]pub struct Notice {
pub severity: NoticeSeverity,
pub title: String,
pub description: Option<String>,
pub meta: Option<Map<String, Value>>,
}unstable_protocol_v2 only.Expand description
Fire-and-forget information for the user.
Notices are live events rather than session history. Agents must not rely on a notice being received, displayed, or seen by the user. No Client capability is required, and unsupported Clients may ignore notices.
See protocol docs: Session Notices
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.severity: NoticeSeverityPresentation severity hint.
title: StringRequired non-empty plain-text title that can stand alone.
description: Option<String>Optional plain-text detail or guidance.
Omitted and null are equivalent and mean no description was supplied.
meta: Option<Map<String, Value>>The _meta property is reserved by ACP to allow clients and agents to attach additional
metadata to their interactions. Omitted and null are equivalent and mean no metadata.
Implementations MUST NOT make assumptions about values at these keys.
See protocol docs: Extensibility
Implementations§
Source§impl Notice
impl Notice
Sourcepub fn new(severity: NoticeSeverity, title: impl Into<String>) -> Notice
pub fn new(severity: NoticeSeverity, title: impl Into<String>) -> Notice
Builds a notice with the required fields set and optional fields omitted.
Sourcepub fn description(self, description: impl IntoOption<String>) -> Notice
pub fn description(self, description: impl IntoOption<String>) -> Notice
Sets or clears the optional description.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Notice
impl<'de> Deserialize<'de> for Notice
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Notice, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Notice, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for Notice
Source§impl JsonSchema for Notice
impl JsonSchema for Notice
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Serialize for Notice
impl Serialize for Notice
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Notice
Auto Trait Implementations§
impl Freeze for Notice
impl RefUnwindSafe for Notice
impl Send for Notice
impl Sync for Notice
impl Unpin for Notice
impl UnsafeUnpin for Notice
impl UnwindSafe for Notice
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
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>,
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
key and return true if they are equal.