Struct RandomConnectionIdGenerator
pub struct RandomConnectionIdGenerator { /* private fields */ }quic and std only.Expand description
Generates purely random connection IDs of a specified length
Random CIDs can be smaller than those produced by HashedConnectionIdGenerator, but cannot be
usefully validated.
Implementations§
§impl RandomConnectionIdGenerator
impl RandomConnectionIdGenerator
pub fn new(cid_len: usize) -> Result<RandomConnectionIdGenerator, ConfigError>
pub fn new(cid_len: usize) -> Result<RandomConnectionIdGenerator, ConfigError>
A generator of identifiers cid_len bytes long, at most MAX_CID_SIZE.
Fails for a longer length, which QUIC has no room for (RFC 9000 §17.2).
pub fn of_max_size() -> RandomConnectionIdGenerator
pub fn of_max_size() -> RandomConnectionIdGenerator
A generator of identifiers of the longest size QUIC carries.
pub fn maybe_with_lifetime(
self,
lifetime: Option<Duration>,
) -> RandomConnectionIdGenerator
pub fn maybe_with_lifetime( self, lifetime: Option<Duration>, ) -> RandomConnectionIdGenerator
How long the identifiers this generator creates are used before they are retired.
None, the default, retires them only when the peer or the protocol asks.
pub fn maybe_set_lifetime(
&mut self,
lifetime: Option<Duration>,
) -> &mut RandomConnectionIdGenerator
pub fn maybe_set_lifetime( &mut self, lifetime: Option<Duration>, ) -> &mut RandomConnectionIdGenerator
How long the identifiers this generator creates are used before they are retired.
None, the default, retires them only when the peer or the protocol asks.
pub fn with_lifetime(self, lifetime: Duration) -> RandomConnectionIdGenerator
pub fn with_lifetime(self, lifetime: Duration) -> RandomConnectionIdGenerator
How long the identifiers this generator creates are used before they are retired.
None, the default, retires them only when the peer or the protocol asks.
pub fn set_lifetime(
&mut self,
lifetime: Duration,
) -> &mut RandomConnectionIdGenerator
pub fn set_lifetime( &mut self, lifetime: Duration, ) -> &mut RandomConnectionIdGenerator
How long the identifiers this generator creates are used before they are retired.
None, the default, retires them only when the peer or the protocol asks.
pub fn without_lifetime(self) -> RandomConnectionIdGenerator
pub fn without_lifetime(self) -> RandomConnectionIdGenerator
How long the identifiers this generator creates are used before they are retired.
None, the default, retires them only when the peer or the protocol asks.
pub fn unset_lifetime(&mut self) -> &mut RandomConnectionIdGenerator
pub fn unset_lifetime(&mut self) -> &mut RandomConnectionIdGenerator
How long the identifiers this generator creates are used before they are retired.
None, the default, retires them only when the peer or the protocol asks.
Trait Implementations§
§impl Clone for RandomConnectionIdGenerator
impl Clone for RandomConnectionIdGenerator
§fn clone(&self) -> RandomConnectionIdGenerator
fn clone(&self) -> RandomConnectionIdGenerator
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl ConnectionIdGenerator for RandomConnectionIdGenerator
impl ConnectionIdGenerator for RandomConnectionIdGenerator
§fn generate_cid(&mut self) -> ConnectionId
fn generate_cid(&mut self) -> ConnectionId
§fn cid_lifetime(&self) -> Option<Duration>
fn cid_lifetime(&self) -> Option<Duration>
§fn validate(&self, _cid: &ConnectionId) -> Result<(), InvalidCid>
fn validate(&self, _cid: &ConnectionId) -> Result<(), InvalidCid>
cid could have been generated by this generator Read moreimpl Copy for RandomConnectionIdGenerator
§impl Debug for RandomConnectionIdGenerator
impl Debug for RandomConnectionIdGenerator
§impl Default for RandomConnectionIdGenerator
impl Default for RandomConnectionIdGenerator
§fn default() -> RandomConnectionIdGenerator
fn default() -> RandomConnectionIdGenerator
Auto Trait Implementations§
impl Freeze for RandomConnectionIdGenerator
impl RefUnwindSafe for RandomConnectionIdGenerator
impl Send for RandomConnectionIdGenerator
impl Sync for RandomConnectionIdGenerator
impl Unpin for RandomConnectionIdGenerator
impl UnsafeUnpin for RandomConnectionIdGenerator
impl UnwindSafe for RandomConnectionIdGenerator
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