pub struct RpcContext {
pub request_id: u64,
pub peer_addr: Option<SocketAddr>,
pub service_id: u16,
pub method_id: u16,
}Expand description
Context available to RPC handlers during request processing.
Provides metadata about the current request and the connection it arrived on.
Fields§
§request_id: u64Unique ID for this request.
peer_addr: Option<SocketAddr>Peer address of the client.
service_id: u16Service ID being called.
method_id: u16Method ID being called.
Implementations§
Source§impl RpcContext
impl RpcContext
pub fn new(request_id: u64, service_id: u16, method_id: u16) -> Self
pub fn with_peer_addr(self, addr: SocketAddr) -> Self
Trait Implementations§
Source§impl Clone for RpcContext
impl Clone for RpcContext
Source§fn clone(&self) -> RpcContext
fn clone(&self) -> RpcContext
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 RpcContext
impl RefUnwindSafe for RpcContext
impl Send for RpcContext
impl Sync for RpcContext
impl Unpin for RpcContext
impl UnsafeUnpin for RpcContext
impl UnwindSafe for RpcContext
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