Struct jsonrpc::simple_tcp::TcpTransport
source · pub struct TcpTransport {
pub addr: SocketAddr,
pub timeout: Option<Duration>,
}
Expand description
Simple synchronous TCP transport.
Fields§
§addr: SocketAddr
The internet socket address to connect to.
timeout: Option<Duration>
The read and write timeout to use for this connection.
Implementations§
source§impl TcpTransport
impl TcpTransport
sourcepub fn new(addr: SocketAddr) -> TcpTransport
pub fn new(addr: SocketAddr) -> TcpTransport
Creates a new TcpTransport
without timeouts.
Trait Implementations§
source§impl Clone for TcpTransport
impl Clone for TcpTransport
source§fn clone(&self) -> TcpTransport
fn clone(&self) -> TcpTransport
Returns a copy 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 moresource§impl Debug for TcpTransport
impl Debug for TcpTransport
source§impl Transport for TcpTransport
impl Transport for TcpTransport
source§fn send_request(&self, req: Request<'_>) -> Result<Response, Error>
fn send_request(&self, req: Request<'_>) -> Result<Response, Error>
Sends an RPC request over the transport.
source§fn send_batch(&self, reqs: &[Request<'_>]) -> Result<Vec<Response>, Error>
fn send_batch(&self, reqs: &[Request<'_>]) -> Result<Vec<Response>, Error>
Sends a batch of RPC requests over the transport.
source§fn fmt_target(&self, f: &mut Formatter<'_>) -> Result
fn fmt_target(&self, f: &mut Formatter<'_>) -> Result
Formats the target of this transport. I.e. the URL/socket/…
Auto Trait Implementations§
impl RefUnwindSafe for TcpTransport
impl Send for TcpTransport
impl Sync for TcpTransport
impl Unpin for TcpTransport
impl UnwindSafe for TcpTransport
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