pub struct Endpoint { /* private fields */ }Expand description
A wrapper around a quinn::Endpoint that translates between SCION and ip:port addresses.
This is necessary because 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 new_with_abstract_socket(
config: EndpointConfig,
server_config: Option<ServerConfig>,
socket: Arc<dyn AsyncUdpSocket>,
runtime: Arc<dyn Runtime>,
pather: Arc<dyn PathPrefetcher + Send + Sync>,
address_translator: Arc<AddressTranslator>,
) -> Result<Self>
pub fn new_with_abstract_socket( config: EndpointConfig, server_config: Option<ServerConfig>, socket: Arc<dyn AsyncUdpSocket>, runtime: Arc<dyn Runtime>, pather: Arc<dyn PathPrefetcher + Send + Sync>, address_translator: Arc<AddressTranslator>, ) -> Result<Self>
Creates a new 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.
Auto Trait Implementations§
impl Freeze for Endpoint
impl !RefUnwindSafe for Endpoint
impl Send for Endpoint
impl Sync for Endpoint
impl Unpin 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> 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