pub enum ServerNotification {
Cancelled {
request_id: Option<RequestId>,
reason: Option<String>,
_meta: Option<HashMap<String, Value>>,
},
Progress {
progress_token: ProgressToken,
progress: f64,
total: Option<f64>,
message: Option<String>,
_meta: Option<HashMap<String, Value>>,
},
LoggingMessage {
level: LoggingLevel,
logger: Option<String>,
data: Value,
_meta: Option<HashMap<String, Value>>,
},
ResourceUpdated {
uri: String,
_meta: Option<HashMap<String, Value>>,
},
ResourceListChanged {
_meta: Option<HashMap<String, Value>>,
},
ToolListChanged {
_meta: Option<HashMap<String, Value>>,
},
PromptListChanged {
_meta: Option<HashMap<String, Value>>,
},
ElicitationComplete {
elicitation_id: String,
},
TaskStatus {
params: TaskStatusNotificationParams,
},
}Expand description
Notifications sent from the server to the client
Variants§
Cancelled
This notification can be sent by either side to indicate that it is cancelling a previously-issued request.
The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.
This notification indicates that the result will be unused, so any associated processing SHOULD cease.
A client MUST NOT attempt to cancel its initialize request.
Fields
Progress
Fields
progress_token: ProgressTokenThe progress token which was given in the initial request.
LoggingMessage
Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.
Fields
level: LoggingLevelThe severity of this log message.
ResourceUpdated
A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request.
Fields
ResourceListChanged
An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client.
ToolListChanged
An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client.
PromptListChanged
An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client.
ElicitationComplete
An optional notification from the server to the client, informing it of completion of an out-of-band elicitation request.
TaskStatus
An optional notification informing that a task’s status has changed.
Fields
params: TaskStatusNotificationParamsImplementations§
Source§impl ServerNotification
impl ServerNotification
Sourcepub fn cancelled(request_id: Option<RequestId>, reason: Option<String>) -> Self
pub fn cancelled(request_id: Option<RequestId>, reason: Option<String>) -> Self
Create a new Cancelled notification
Sourcepub fn progress(
progress_token: ProgressToken,
progress: f64,
total: Option<f64>,
message: Option<String>,
) -> Self
pub fn progress( progress_token: ProgressToken, progress: f64, total: Option<f64>, message: Option<String>, ) -> Self
Create a new Progress notification
Sourcepub fn logging_message(
level: LoggingLevel,
logger: Option<String>,
data: Value,
) -> Self
pub fn logging_message( level: LoggingLevel, logger: Option<String>, data: Value, ) -> Self
Create a new LoggingMessage notification
Sourcepub fn resource_updated(uri: impl Into<String>) -> Self
pub fn resource_updated(uri: impl Into<String>) -> Self
Create a new ResourceUpdated notification
Sourcepub fn resource_list_changed() -> Self
pub fn resource_list_changed() -> Self
Create a new ResourceListChanged notification
Sourcepub fn tool_list_changed() -> Self
pub fn tool_list_changed() -> Self
Create a new ToolListChanged notification
Sourcepub fn prompt_list_changed() -> Self
pub fn prompt_list_changed() -> Self
Create a new PromptListChanged notification
Sourcepub fn elicitation_complete(elicitation_id: impl Into<String>) -> Self
pub fn elicitation_complete(elicitation_id: impl Into<String>) -> Self
Create a new ElicitationComplete notification
Sourcepub fn task_status(params: TaskStatusNotificationParams) -> Self
pub fn task_status(params: TaskStatusNotificationParams) -> Self
Create a new TaskStatus notification
Trait Implementations§
Source§impl Clone for ServerNotification
impl Clone for ServerNotification
Source§fn clone(&self) -> ServerNotification
fn clone(&self) -> ServerNotification
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more