pub struct UtpSocket(/* private fields */);
Expand description
A reference to an existing UtpSocket
that can be shared amongst multiple
tasks. This can’t function unless the corresponding UtpSocketDriver
is
scheduled to run on the same runtime.
Implementations§
Source§impl UtpSocketRef
impl UtpSocketRef
Sourcepub async fn bind<A: ToSocketAddrs>(addr: A) -> Result<Self>
pub async fn bind<A: ToSocketAddrs>(addr: A) -> Result<Self>
Bind an unconnected UtpSocket
on the given address.
Sourcepub async fn connect(
self,
dst: SocketAddr,
) -> Result<(UtpStream, UtpStreamDriver)>
pub async fn connect( self, dst: SocketAddr, ) -> Result<(UtpStream, UtpStreamDriver)>
Connect to a remote host using this UtpSocket
Sourcepub async fn accept(self) -> Result<(UtpStream, UtpStreamDriver)>
pub async fn accept(self) -> Result<(UtpStream, UtpStreamDriver)>
Accept an incoming connection using this UtpSocket
. This also
returns a UtpStreamDriver
that must be scheduled on a runtime
in order for the associated UtpStream
to work properly.
Accepting a new connection will consume this listener.
Sourcepub fn local_addr(&self) -> SocketAddr
pub fn local_addr(&self) -> SocketAddr
Get the local address for this UtpSocket
Auto Trait Implementations§
impl Freeze for UtpSocketRef
impl !RefUnwindSafe for UtpSocketRef
impl Send for UtpSocketRef
impl Sync for UtpSocketRef
impl Unpin for UtpSocketRef
impl !UnwindSafe for UtpSocketRef
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