pub enum ServerMessage {
Notification(Notification),
Request {
id: RequestId,
request: ServerRequest,
},
}Expand description
A message coming from the app-server.
Replaces the previous loose { method, params } shape with typed enums.
Match on the outer variant first to distinguish notifications (no response)
from requests (need crate::AsyncClient::respond /
crate::SyncClient::respond).
Variants§
Notification(Notification)
A notification — no response required.
Request
A request — call respond(id, ...) on the client with the matching id.
Implementations§
Source§impl ServerMessage
impl ServerMessage
Sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
true if this message is an unmodeled method (notification or request).
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 (const: unstable) · 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