pub struct Endpoint { /* private fields */ }Expand description
A wrapper around a anapaya_quinn::Endpoint that translates between SCION and ip:port addresses.
This is necessary because anapaya_quinn expects a std::net::SocketAddr, but SCION uses scion_proto::address::SocketAddr.
Addresses are mapped by the provided ScionAsyncUdpSocket.
Implementations§
Source§impl Endpoint
impl Endpoint
Sourcepub fn connect(
&self,
addr: SocketAddr,
server_name: &str,
) -> Result<Connecting, ConnectError>
pub fn connect( &self, addr: SocketAddr, server_name: &str, ) -> Result<Connecting, ConnectError>
Connect to the address.
Sourcepub async fn accept(&self) -> Result<Option<ScionQuinnConn>, ConnectionError>
pub async fn accept(&self) -> Result<Option<ScionQuinnConn>, ConnectionError>
Accepts a new incoming connection.
Sourcepub fn set_default_client_config(&mut self, config: ClientConfig)
pub fn set_default_client_config(&mut self, config: ClientConfig)
Set the default QUIC client configuration.
Sourcepub fn local_addr(&self) -> Result<SocketAddr>
pub fn local_addr(&self) -> Result<SocketAddr>
Returns the local socket address of the endpoint.
Sourcepub fn local_scion_addr(&self) -> SocketAddr
pub fn local_scion_addr(&self) -> SocketAddr
Returns the local SCION address of the endpoint.
Sourcepub fn snap_data_plane(&self) -> Option<SocketAddr>
pub fn snap_data_plane(&self) -> Option<SocketAddr>
Snap data plane address the endpoint is connected to, if any.
Auto Trait Implementations§
impl Freeze for Endpoint
impl !RefUnwindSafe for Endpoint
impl Send for Endpoint
impl Sync for Endpoint
impl Unpin for Endpoint
impl UnsafeUnpin for Endpoint
impl !UnwindSafe for Endpoint
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
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>
Converts
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>
Converts
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>
Wrap the input message
T in a tonic::Request