[−][src]Struct aurpc::RpcSocket
A RPC socket.
After creating a RpcSocket
by bind
ing it to a socket address, RPCs
can be sent to
and received from
any other socket address.
Implementations
impl RpcSocket
[src]
pub async fn bind<A: ToSocketAddrs>(addrs: A) -> Result<Self>
[src]
Creates a RPC socket from the given address.
Binding with a port number of 0 will request that the OS assigns a port
to this socket. THe port allocated can be queried via the local_addr
method.
pub fn local_addr(&self) -> Result<SocketAddr>
[src]
Returns the local address that this listener is bound to.
This can be useful, for example, when binding to port 0 to figure out which port was actually bound.
pub async fn send_to<'a, '_, '_, A: ToSocketAddrs>(
&'_ self,
buf: &'_ [u8],
rsp_buf: &'a mut [u8],
addrs: A
) -> Result<(usize, ResponseFuture<'a>)>
[src]
&'_ self,
buf: &'_ [u8],
rsp_buf: &'a mut [u8],
addrs: A
) -> Result<(usize, ResponseFuture<'a>)>
Sends an RPC on the socket to the given address.
On success, returns the number of bytes written to and read from the socket.
pub async fn recv_from<'_, '_>(
&'_ self,
buf: &'_ mut [u8]
) -> Result<(usize, RpcResponder)>
[src]
&'_ self,
buf: &'_ mut [u8]
) -> Result<(usize, RpcResponder)>
Receives RPC from the socket.
On success, returns the number of bytes read and the origin.
pub fn ttl(&self) -> Result<u32>
[src]
Gets the value of the IP_TTL
option for this socket.
For more information about this option, see set_ttl
.
pub fn set_ttl(&self, ttl: u32) -> Result<()>
[src]
Sets the value for the IP_TTL
option on this socket.
This value sets the time-to-live field that is used in every packet sent from this socket.
Auto Trait Implementations
impl !RefUnwindSafe for RpcSocket
impl Send for RpcSocket
impl Sync for RpcSocket
impl Unpin for RpcSocket
impl !UnwindSafe for RpcSocket
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,