pub struct ClientProtocolConfig(pub(crate) Vec<ProtocolVersion>);Expand description
Client protocol configuration - defines what versions the client supports
Tuple Fields§
§0: Vec<ProtocolVersion>Implementations§
Source§impl ClientProtocolConfig
impl ClientProtocolConfig
Sourcepub fn add_current_version(
self,
variant: ProtocolVariant,
version: Version,
) -> Self
pub fn add_current_version( self, variant: ProtocolVariant, version: Version, ) -> Self
Add a current version for a protocol variant
Sourcepub fn alpn_protocols(&self) -> Vec<Vec<u8>>
pub fn alpn_protocols(&self) -> Vec<Vec<u8>>
Get ALPN protocol identifiers for TLS negotiation
Sourcepub fn supported_versions(&self) -> Vec<ProtocolVersion>
pub fn supported_versions(&self) -> Vec<ProtocolVersion>
Get all supported versions as a vector
Sourcepub fn validate_negotiation(
&self,
server_requirements: &ServerProtocolConfig,
) -> Option<ProtocolVersion>
pub fn validate_negotiation( &self, server_requirements: &ServerProtocolConfig, ) -> Option<ProtocolVersion>
Validate that client and server would negotiate to the same version This should be called by the client after receiving server’s ALPN requirements
Sourcepub fn relay_default() -> Self
pub fn relay_default() -> Self
Create default client configuration for relay protocol
Trait Implementations§
Source§impl Clone for ClientProtocolConfig
impl Clone for ClientProtocolConfig
Source§fn clone(&self) -> ClientProtocolConfig
fn clone(&self) -> ClientProtocolConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ClientProtocolConfig
impl Debug for ClientProtocolConfig
Source§impl Default for ClientProtocolConfig
impl Default for ClientProtocolConfig
Source§impl<'de> Deserialize<'de> for ClientProtocolConfig
impl<'de> Deserialize<'de> for ClientProtocolConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ClientProtocolConfig
impl RefUnwindSafe for ClientProtocolConfig
impl Send for ClientProtocolConfig
impl Sync for ClientProtocolConfig
impl Unpin for ClientProtocolConfig
impl UnwindSafe for ClientProtocolConfig
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
Mutably borrows from an owned value. Read more