Struct fibers_transport::RcTransporter [−][src]
pub struct RcTransporter<T: Transport>(_);
Shareable transporter.
Methods
impl<T: Transport> RcTransporter<T>
[src]
impl<T: Transport> RcTransporter<T>
pub fn new(inner: T) -> Self
[src]
pub fn new(inner: T) -> Self
Makes a new RcTransporter
instance.
pub fn with_inner_ref<F, U>(&self, f: F) -> U where
F: FnOnce(&T) -> U,
[src]
pub fn with_inner_ref<F, U>(&self, f: F) -> U where
F: FnOnce(&T) -> U,
Executes the given function with a reference to the inner transporter.
pub fn with_inner_mut<F, U>(&mut self, f: F) -> U where
F: FnOnce(&mut T) -> U,
[src]
pub fn with_inner_mut<F, U>(&mut self, f: F) -> U where
F: FnOnce(&mut T) -> U,
Executes the given function with a mutable reference to the inner transporter.
pub fn with_peek_recv<F, U>(&mut self, f: F) -> Result<Option<U>> where
F: FnOnce(&T::PeerAddr, &T::RecvItem) -> U,
[src]
pub fn with_peek_recv<F, U>(&mut self, f: F) -> Result<Option<U>> where
F: FnOnce(&T::PeerAddr, &T::RecvItem) -> U,
Executes the given function with the next incoming item if it is available.
If there is no such item, this will return Ok(None)
without executing f
.
Trait Implementations
impl<T: Debug + Transport> Debug for RcTransporter<T>
[src]
impl<T: Debug + Transport> Debug for RcTransporter<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: Transport> Clone for RcTransporter<T>
[src]
impl<T: Transport> Clone for RcTransporter<T>
fn clone(&self) -> Self
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<T: Transport> Transport for RcTransporter<T>
[src]
impl<T: Transport> Transport for RcTransporter<T>
type PeerAddr = T::PeerAddr
Peer address.
type SendItem = T::SendItem
Outgoing item.
type RecvItem = T::RecvItem
Incoming item.
fn start_send(
&mut self,
peer: Self::PeerAddr,
item: Self::SendItem
) -> Result<()>
[src]
fn start_send(
&mut self,
peer: Self::PeerAddr,
item: Self::SendItem
) -> Result<()>
Starts sending the given item to the destination peer.
fn poll_send(&mut self) -> PollSend
[src]
fn poll_send(&mut self) -> PollSend
Polls the transmission of the all outstanding items in the transporter have been completed. Read more
fn poll_recv(&mut self) -> PollRecv<(Self::PeerAddr, Self::RecvItem)>
[src]
fn poll_recv(&mut self) -> PollRecv<(Self::PeerAddr, Self::RecvItem)>
Polls reception of an item from a peer. Read more
impl<T: TcpTransport> TcpTransport for RcTransporter<T>
[src]
impl<T: TcpTransport> TcpTransport for RcTransporter<T>
fn peer_addr(&self) -> SocketAddr
[src]
fn peer_addr(&self) -> SocketAddr
Returns the address of the connected peer.
fn local_addr(&self) -> SocketAddr
[src]
fn local_addr(&self) -> SocketAddr
Returns the address to which the instance is bound.
impl<T: UdpTransport> UdpTransport for RcTransporter<T>
[src]
impl<T: UdpTransport> UdpTransport for RcTransporter<T>
fn local_addr(&self) -> SocketAddr
[src]
fn local_addr(&self) -> SocketAddr
Returns the address to which the instance is bound.
Auto Trait Implementations
impl<T> !Send for RcTransporter<T>
impl<T> !Send for RcTransporter<T>
impl<T> !Sync for RcTransporter<T>
impl<T> !Sync for RcTransporter<T>