pub enum ServerMessage {
Notification {
method: String,
params: Option<Value>,
},
Request {
id: RequestId,
method: String,
params: Option<Value>,
},
}Expand description
An incoming message from the app-server that the client should handle.
This is what AsyncClient::next_message and
SyncClient::next_message return.
§Handling
- Notifications are informational — no response is needed. Match on the
methodfield and deserializeparamsinto the appropriate notification type. - Requests require a response via
client.respond(id, &result). Currently used for approval flows (item/commandExecution/requestApprovalanditem/fileChange/requestApproval).
Variants§
Notification
A notification (no response needed). Deserialize params based on method.
Request
A request from the server that needs a response (e.g., approval flow).
Use the client’s respond() method with the id.
Trait Implementations§
Source§impl Clone for ServerMessage
impl Clone for ServerMessage
Source§fn clone(&self) -> ServerMessage
fn clone(&self) -> ServerMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ServerMessage
impl RefUnwindSafe for ServerMessage
impl Send for ServerMessage
impl Sync for ServerMessage
impl Unpin for ServerMessage
impl UnsafeUnpin for ServerMessage
impl UnwindSafe for ServerMessage
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
Mutably borrows from an owned value. Read more