pub struct PathUnawareUdpScionSocket { /* private fields */ }Expand description
A path unaware UDP SCION socket.
Implementations§
Source§impl PathUnawareUdpScionSocket
impl PathUnawareUdpScionSocket
Sourcepub fn send_to_via<'a>(
&'a self,
payload: &[u8],
destination: SocketAddr,
path: &Path<&[u8]>,
) -> BoxFuture<'a, Result<(), ScionSocketSendError>>
pub fn send_to_via<'a>( &'a self, payload: &[u8], destination: SocketAddr, path: &Path<&[u8]>, ) -> BoxFuture<'a, Result<(), ScionSocketSendError>>
Send a SCION UDP datagram via the given path.
§Cancel safety
This method is cancel-safe. If the future is dropped before completion, the packet may be silently lost, but no socket state is corrupted and the socket remains usable.
Sourcepub fn recv_from_with_path<'a>(
&'a self,
buffer: &'a mut [u8],
path_buffer: &'a mut [u8],
) -> BoxFuture<'a, Result<(usize, SocketAddr, Path<&'a mut [u8]>), ScionSocketReceiveError>>
pub fn recv_from_with_path<'a>( &'a self, buffer: &'a mut [u8], path_buffer: &'a mut [u8], ) -> BoxFuture<'a, Result<(usize, SocketAddr, Path<&'a mut [u8]>), ScionSocketReceiveError>>
Receive a SCION packet with the sender and path.
§Cancel safety
This method is cancel-safe. The only await point is the inner underlay receive. If the
future is dropped while waiting for a packet, no packet data is consumed and buffer
and path_buffer are left unmodified. If a packet has already been received (i.e., the
future is dropped after data has been written into the buffers), this cannot occur in
practice because those steps run synchronously within a single poll invocation.
Sourcepub fn recv_from<'a>(
&'a self,
buffer: &'a mut [u8],
) -> BoxFuture<'a, Result<(usize, SocketAddr), ScionSocketReceiveError>>
pub fn recv_from<'a>( &'a self, buffer: &'a mut [u8], ) -> BoxFuture<'a, Result<(usize, SocketAddr), ScionSocketReceiveError>>
Receive a SCION packet with the sender.
§Cancel safety
This method is cancel-safe. If the future is dropped while waiting for a packet, no
packet is consumed and buffer is left unmodified. The contents of buffer are only
valid after the method returns Ok.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PathUnawareUdpScionSocket
impl !RefUnwindSafe for PathUnawareUdpScionSocket
impl Send for PathUnawareUdpScionSocket
impl Sync for PathUnawareUdpScionSocket
impl Unpin for PathUnawareUdpScionSocket
impl UnsafeUnpin for PathUnawareUdpScionSocket
impl !UnwindSafe for PathUnawareUdpScionSocket
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request