pub enum ServerNotification {
Cancelled(FinalCancelledNotificationParams),
Progress(FinalProgressNotificationParams),
Message(FinalLogMessageParams),
ResourceUpdated(FinalResourceUpdatedNotificationParams),
ResourcesListChanged(Option<FinalEmptyNotificationParams>),
ToolsListChanged(Option<FinalEmptyNotificationParams>),
PromptsListChanged(Option<FinalEmptyNotificationParams>),
SubscriptionsAcknowledged(FinalSubscriptionsAcknowledgedNotificationParams),
}Expand description
The eight notifications a final server may originate.
Variants§
Cancelled(FinalCancelledNotificationParams)
notifications/cancelled for a server-terminated subscription stream.
Progress(FinalProgressNotificationParams)
notifications/progress for an in-flight client request.
Message(FinalLogMessageParams)
notifications/message log event.
ResourceUpdated(FinalResourceUpdatedNotificationParams)
notifications/resources/updated resource change event.
ResourcesListChanged(Option<FinalEmptyNotificationParams>)
notifications/resources/list_changed catalog change event.
ToolsListChanged(Option<FinalEmptyNotificationParams>)
notifications/tools/list_changed catalog change event.
PromptsListChanged(Option<FinalEmptyNotificationParams>)
notifications/prompts/list_changed catalog change event.
SubscriptionsAcknowledged(FinalSubscriptionsAcknowledgedNotificationParams)
notifications/subscriptions/acknowledged stream acknowledgement.
Implementations§
Source§impl ServerNotification
impl ServerNotification
Sourcepub fn decode(request: &JsonRpcRequest) -> Result<Self, FinalNotificationError>
pub fn decode(request: &JsonRpcRequest) -> Result<Self, FinalNotificationError>
Admits one JSON-RPC notification only from the exact final server union.
Sourcepub fn decode_with_raw_params(
request: &JsonRpcRequest,
raw_params: &str,
) -> Result<Self, FinalNotificationError>
pub fn decode_with_raw_params( request: &JsonRpcRequest, raw_params: &str, ) -> Result<Self, FinalNotificationError>
Decodes a final server notification with the exact received params JSON.
Only the modern progress branch needs this companion to preserve native-size
decimal and exponent spellings that a materialized Value normalizes.
The caller must pass the raw params member from the same admitted frame.
Other final notification branches use Self::decode unchanged.
Sourcepub fn encode(&self) -> Result<JsonRpcRequest, FinalNotificationError>
pub fn encode(&self) -> Result<JsonRpcRequest, FinalNotificationError>
Encodes this typed union as an ID-free JSON-RPC notification.
Sourcepub fn encode_wire(&self) -> Result<String, FinalNotificationError>
pub fn encode_wire(&self) -> Result<String, FinalNotificationError>
Serializes this notification as its exact JSON-RPC wire frame.
encode carries its params as serde_json::Value,
whose map representation cannot preserve member order, so byte-exact
emission and round-trip fidelity proofs must use this string encoder:
the typed params serialize directly, preserving declaration order and
raw number lexemes.
Trait Implementations§
Source§impl Clone for ServerNotification
impl Clone for ServerNotification
Source§fn clone(&self) -> ServerNotification
fn clone(&self) -> ServerNotification
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more