Enum jsonrpsee_core::server::CallOrSubscription
source · pub enum CallOrSubscription {
Subscription(MethodResponse),
Call(MethodResponse),
}
Expand description
This represent a response to a RPC call
and Subscribe
calls are handled differently
because we want to prevent subscriptions to start
before the actual subscription call has been answered.
Variants§
Subscription(MethodResponse)
The subscription callback itself sends back the result so it must not be sent back again.
Call(MethodResponse)
Treat it as ordinary call.
Implementations§
source§impl CallOrSubscription
impl CallOrSubscription
sourcepub fn as_response(&self) -> &MethodResponse
pub fn as_response(&self) -> &MethodResponse
Extract the JSON-RPC response.
sourcepub fn into_response(self) -> MethodResponse
pub fn into_response(self) -> MethodResponse
Extract the JSON-RPC response.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CallOrSubscription
impl !RefUnwindSafe for CallOrSubscription
impl Send for CallOrSubscription
impl Sync for CallOrSubscription
impl Unpin for CallOrSubscription
impl !UnwindSafe for CallOrSubscription
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