#[non_exhaustive]pub struct Notice {
pub severity: NoticeSeverity,
pub title: String,
pub description: Option<String>,
pub meta: Option<Meta>,
}Expand description
UNSTABLE
This capability is not part of the spec yet, and may be removed or changed at any point.
Fire-and-forget advisory 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 RFD: 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<Meta>Metadata scoped to this notice.
Omitted and null are equivalent and mean no metadata was supplied.
Implementations§
Source§impl Notice
impl Notice
Sourcepub fn new(severity: NoticeSeverity, title: impl Into<String>) -> Self
Available on crate feature unstable_session_notices only.
pub fn new(severity: NoticeSeverity, title: impl Into<String>) -> Self
unstable_session_notices only.Builds a notice with the required fields set and optional fields omitted.
Sourcepub fn description(self, description: impl IntoOption<String>) -> Self
Available on crate feature unstable_session_notices only.
pub fn description(self, description: impl IntoOption<String>) -> Self
unstable_session_notices only.Sets or clears the optional description.
Sourcepub fn meta(self, meta: impl IntoOption<Meta>) -> Self
Available on crate feature unstable_session_notices only.
pub fn meta(self, meta: impl IntoOption<Meta>) -> Self
unstable_session_notices only.Sets or clears notice-scoped metadata.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Notice
impl<'de> Deserialize<'de> for Notice
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>,
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 moreimpl 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.