Struct ServerVersionPolicy
pub struct ServerVersionPolicy { /* private fields */ }quic only.Expand description
How a server negotiates versions (RFC 9368 §2.3, §5).
The acceptable versions are the endpoint’s supported set; this policy adds what a Version Negotiation packet offers, what the server reports as fully deployed, and which compatible version it prefers. By default it offers and reports everything it accepts and keeps the client’s choice.
Implementations§
§impl ServerVersionPolicy
impl ServerVersionPolicy
pub fn new() -> ServerVersionPolicy
pub fn new() -> ServerVersionPolicy
Offer and report everything the endpoint accepts, keep the client’s choice, and grease the advertised list with a reserved version.
pub fn try_with_offered(
self,
offered: Vec<Version>,
) -> Result<ServerVersionPolicy, VersionPolicyError>
pub fn try_with_offered( self, offered: Vec<Version>, ) -> Result<ServerVersionPolicy, VersionPolicyError>
The versions a Version Negotiation packet lists, when narrower than the acceptable set (RFC 9368 §5, “Offered Versions”).
pub fn try_with_fully_deployed(
self,
fully_deployed: Vec<Version>,
) -> Result<ServerVersionPolicy, VersionPolicyError>
pub fn try_with_fully_deployed( self, fully_deployed: Vec<Version>, ) -> Result<ServerVersionPolicy, VersionPolicyError>
The versions reported in version_information, when narrower than the acceptable set
(RFC 9368 §5, “Fully Deployed Versions”). May be empty during a rollout.
pub fn try_with_preference(
self,
preference: VersionPreference,
) -> Result<ServerVersionPolicy, VersionPolicyError>
pub fn try_with_preference( self, preference: VersionPreference, ) -> Result<ServerVersionPolicy, VersionPolicyError>
Which compatible version to move a connection to when the client offers a choice.
pub fn with_reserved_version_grease(self, grease: bool) -> ServerVersionPolicy
pub fn with_reserved_version_grease(self, grease: bool) -> ServerVersionPolicy
Whether to add a reserved version to the reported list. On by default.
pub fn set_reserved_version_grease(
&mut self,
grease: bool,
) -> &mut ServerVersionPolicy
pub fn set_reserved_version_grease( &mut self, grease: bool, ) -> &mut ServerVersionPolicy
Whether to add a reserved version to the reported list. On by default.
pub fn preference(&self) -> &VersionPreference
pub fn preference(&self) -> &VersionPreference
Which compatible version this server moves a connection to.
pub fn may_switch(&self) -> bool
pub fn may_switch(&self) -> bool
Whether this policy can ever pick a version other than the client’s.
pub fn offered<'a>(&'a self, acceptable: &'a [Version]) -> &'a [Version]
pub fn offered<'a>(&'a self, acceptable: &'a [Version]) -> &'a [Version]
The versions a Version Negotiation packet lists.
pub fn negotiate(
&self,
chosen: Version,
client_available: Option<&[Version]>,
acceptable: &[Version],
) -> Version
pub fn negotiate( &self, chosen: Version, client_available: Option<&[Version]>, acceptable: &[Version], ) -> Version
The version to continue in, given the client’s first flight version and what it says that flight is compatible with (RFC 9368 §2.3, RFC 9369 §4.1).
pub fn information(
&self,
negotiated: Version,
acceptable: &[Version],
grease: Version,
) -> VersionInformation
pub fn information( &self, negotiated: Version, acceptable: &[Version], grease: Version, ) -> VersionInformation
What the server advertises: the negotiated version and its fully deployed set.
Trait Implementations§
§impl Clone for ServerVersionPolicy
impl Clone for ServerVersionPolicy
§fn clone(&self) -> ServerVersionPolicy
fn clone(&self) -> ServerVersionPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ServerVersionPolicy
impl Debug for ServerVersionPolicy
§impl Default for ServerVersionPolicy
impl Default for ServerVersionPolicy
§fn default() -> ServerVersionPolicy
fn default() -> ServerVersionPolicy
impl Eq for ServerVersionPolicy
§impl PartialEq for ServerVersionPolicy
impl PartialEq for ServerVersionPolicy
impl StructuralPartialEq for ServerVersionPolicy
Auto Trait Implementations§
impl Freeze for ServerVersionPolicy
impl RefUnwindSafe for ServerVersionPolicy
impl Send for ServerVersionPolicy
impl Sync for ServerVersionPolicy
impl Unpin for ServerVersionPolicy
impl UnsafeUnpin for ServerVersionPolicy
impl UnwindSafe for ServerVersionPolicy
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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