pub enum IrMessage {
Request(IrRequest),
Notification(IrNotification),
Result(IrResult),
Error(IrError),
}Expand description
Any message in either direction.
Variants§
Request(IrRequest)
A request.
Notification(IrNotification)
A notification.
Result(IrResult)
A result.
Error(IrError)
An error.
Implementations§
Source§impl IrMessage
impl IrMessage
Sourcepub const fn method(&self) -> Option<&MethodName>
pub const fn method(&self) -> Option<&MethodName>
The method name, for a request or notification.
Sourcepub const fn id(&self) -> Option<&RequestId>
pub const fn id(&self) -> Option<&RequestId>
The request id, when there is one.
A notification has none, and neither does a parse error, which is why
this is an Option on the message rather than a field.
Sourcepub const fn expects_reply(&self) -> bool
pub const fn expects_reply(&self) -> bool
Whether this message expects a reply.
Sourcepub const fn required_features(&self) -> FeatureSet
pub const fn required_features(&self) -> FeatureSet
The features this message needs in order to be expressed.
Empty for everything in the envelope: none of the four JSON-RPC shapes are version-gated, because the spec’s lifecycle is the same at every revision. The method does the gating instead, and T08’s codec table maps a method to the features its payload needs.
Trait Implementations§
impl StructuralPartialEq for IrMessage
Auto Trait Implementations§
impl Freeze for IrMessage
impl RefUnwindSafe for IrMessage
impl Send for IrMessage
impl Sync for IrMessage
impl Unpin for IrMessage
impl UnsafeUnpin for IrMessage
impl UnwindSafe for IrMessage
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