Struct ockam_transport_tcp::TcpConnection
source · pub struct TcpConnection { /* private fields */ }
Expand description
Result of [TcpTransport::connect
] call.
Implementations§
source§impl TcpConnection
impl TcpConnection
sourcepub fn new(
sender_address: Address,
receiver_address: Address,
socket_address: SocketAddr,
mode: TcpConnectionMode,
flow_control_id: FlowControlId
) -> Self
pub fn new( sender_address: Address, receiver_address: Address, socket_address: SocketAddr, mode: TcpConnectionMode, flow_control_id: FlowControlId ) -> Self
Constructor
sourcepub async fn stop(&self, context: &Context) -> Result<()>
pub async fn stop(&self, context: &Context) -> Result<()>
Stops the TcpConnection
, this method must be called to avoid
leakage of the connection.
Simply dropping this object won’t close the connection
sourcepub fn sender_address(&self) -> &Address
pub fn sender_address(&self) -> &Address
Corresponding TcpSendWorker
Address
that can be used
in a route to send messages to the other side of the TCP connection
sourcepub fn receiver_address(&self) -> &Address
pub fn receiver_address(&self) -> &Address
Corresponding TcpReceiveProcessor
Address
sourcepub fn socket_address(&self) -> &SocketAddr
pub fn socket_address(&self) -> &SocketAddr
Corresponding SocketAddr
sourcepub fn flow_control_id(&self) -> &FlowControlId
pub fn flow_control_id(&self) -> &FlowControlId
Generated fresh random FlowControlId
sourcepub fn mode(&self) -> TcpConnectionMode
pub fn mode(&self) -> TcpConnectionMode
Corresponding TcpConnectionMode
Trait Implementations§
source§impl Clone for TcpConnection
impl Clone for TcpConnection
source§fn clone(&self) -> TcpConnection
fn clone(&self) -> TcpConnection
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 TcpConnection
impl Debug for TcpConnection
source§impl Display for TcpConnection
impl Display for TcpConnection
source§impl From<TcpConnection> for Address
impl From<TcpConnection> for Address
source§fn from(value: TcpConnection) -> Self
fn from(value: TcpConnection) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl RefUnwindSafe for TcpConnection
impl Send for TcpConnection
impl Sync for TcpConnection
impl Unpin for TcpConnection
impl UnwindSafe for TcpConnection
Blanket Implementations§
source§impl<D> AsyncTryClone for D
impl<D> AsyncTryClone for D
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