Struct EndpointBuilder
pub struct EndpointBuilder { /* private fields */ }quic and std only.Expand description
An endpoint being built: the runtime it will live on, what it is configured with, and the socket it will bind.
Implementations§
§impl EndpointBuilder
impl EndpointBuilder
pub fn new(exec: Executor) -> EndpointBuilder
pub fn new(exec: Executor) -> EndpointBuilder
Build a client endpoint whose tasks run through exec.
Unless configured otherwise, construction generates a fresh secret reset key. A random-source failure is returned when binding or attaching a socket.
pub fn maybe_with_config(self, value: Option<EndpointConfig>) -> EndpointBuilder
pub fn maybe_with_config(self, value: Option<EndpointConfig>) -> EndpointBuilder
The endpoint configuration; when omitted, construction generates a random reset key.
pub fn maybe_set_config(
&mut self,
value: Option<EndpointConfig>,
) -> &mut EndpointBuilder
pub fn maybe_set_config( &mut self, value: Option<EndpointConfig>, ) -> &mut EndpointBuilder
The endpoint configuration; when omitted, construction generates a random reset key.
pub fn with_config(self, value: EndpointConfig) -> EndpointBuilder
pub fn with_config(self, value: EndpointConfig) -> EndpointBuilder
The endpoint configuration; when omitted, construction generates a random reset key.
pub fn set_config(&mut self, value: EndpointConfig) -> &mut EndpointBuilder
pub fn set_config(&mut self, value: EndpointConfig) -> &mut EndpointBuilder
The endpoint configuration; when omitted, construction generates a random reset key.
pub fn without_config(self) -> EndpointBuilder
pub fn without_config(self) -> EndpointBuilder
The endpoint configuration; when omitted, construction generates a random reset key.
pub fn unset_config(&mut self) -> &mut EndpointBuilder
pub fn unset_config(&mut self) -> &mut EndpointBuilder
The endpoint configuration; when omitted, construction generates a random reset key.
pub fn maybe_with_server_config(
self,
value: Option<ServerConfig>,
) -> EndpointBuilder
pub fn maybe_with_server_config( self, value: Option<ServerConfig>, ) -> EndpointBuilder
What this endpoint serves incoming connections with
Without a server config, the default, it is a client.
pub fn maybe_set_server_config(
&mut self,
value: Option<ServerConfig>,
) -> &mut EndpointBuilder
pub fn maybe_set_server_config( &mut self, value: Option<ServerConfig>, ) -> &mut EndpointBuilder
What this endpoint serves incoming connections with
Without a server config, the default, it is a client.
pub fn with_server_config(self, value: ServerConfig) -> EndpointBuilder
pub fn with_server_config(self, value: ServerConfig) -> EndpointBuilder
What this endpoint serves incoming connections with
Without a server config, the default, it is a client.
pub fn set_server_config(&mut self, value: ServerConfig) -> &mut EndpointBuilder
pub fn set_server_config(&mut self, value: ServerConfig) -> &mut EndpointBuilder
What this endpoint serves incoming connections with
Without a server config, the default, it is a client.
pub fn without_server_config(self) -> EndpointBuilder
pub fn without_server_config(self) -> EndpointBuilder
What this endpoint serves incoming connections with
Without a server config, the default, it is a client.
pub fn unset_server_config(&mut self) -> &mut EndpointBuilder
pub fn unset_server_config(&mut self) -> &mut EndpointBuilder
What this endpoint serves incoming connections with
Without a server config, the default, it is a client.
pub fn with_shutdown_budget(self, value: Duration) -> EndpointBuilder
pub fn with_shutdown_budget(self, value: Duration) -> EndpointBuilder
How long a shutdown gives the drivers before it stops waiting and forces them. Zero forces immediately.
pub fn set_shutdown_budget(&mut self, value: Duration) -> &mut EndpointBuilder
pub fn set_shutdown_budget(&mut self, value: Duration) -> &mut EndpointBuilder
How long a shutdown gives the drivers before it stops waiting and forces them. Zero forces immediately.
pub async fn bind_address(
self,
address: impl Into<SocketAddress>,
) -> Result<Endpoint, DatagramError>
pub async fn bind_address( self, address: impl Into<SocketAddress>, ) -> Result<Endpoint, DatagramError>
Bind the address, and the addresses this endpoint advertises as preferred with it.
The advertised sockets are bound before the endpoint exists, so it advertises the addresses its sockets have, including ports the platform assigned.
pub async fn bind_address_with_socket_config(
self,
address: impl Into<SocketAddress>,
socket_config: UdpSocketConfig,
) -> Result<Endpoint, DatagramError>
pub async fn bind_address_with_socket_config( self, address: impl Into<SocketAddress>, socket_config: UdpSocketConfig, ) -> Result<Endpoint, DatagramError>
Same as Self::bind_address but with custom UdpSocketConfig.
pub fn with_packet_socket(
self,
socket: UdpPacketSocket,
) -> Result<Endpoint, DatagramError>
pub fn with_packet_socket( self, socket: UdpPacketSocket, ) -> Result<Endpoint, DatagramError>
Build on a packet socket the caller prepared, with its packet metadata set up and its required features validated.
This does not bind preferred-address sockets or change the supplied socket options.
pub fn with_std_socket(
self,
socket: UdpSocket,
) -> Result<Endpoint, DatagramError>
pub fn with_std_socket( self, socket: UdpSocket, ) -> Result<Endpoint, DatagramError>
Build on a bound standard socket. The packet metadata a UdpSocketConfig describes is
not set up here; a caller that needs it wraps the socket first and uses
with_packet_socket.
Trait Implementations§
§impl Clone for EndpointBuilder
impl Clone for EndpointBuilder
§fn clone(&self) -> EndpointBuilder
fn clone(&self) -> EndpointBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for EndpointBuilder
impl !UnwindSafe for EndpointBuilder
impl Freeze for EndpointBuilder
impl Send for EndpointBuilder
impl Sync for EndpointBuilder
impl Unpin for EndpointBuilder
impl UnsafeUnpin for EndpointBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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 more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more