pub struct ProtocolRange {
pub minimum: ProtocolVersion,
pub maximum: ProtocolVersion,
}Expand description
A client’s acceptable range for protocol negotiation.
Fields§
§minimum: ProtocolVersionLowest accepted version.
maximum: ProtocolVersionHighest accepted version.
Implementations§
Source§impl ProtocolRange
impl ProtocolRange
Sourcepub fn negotiate(
self,
server: ProtocolVersion,
) -> Result<ProtocolVersion, ProtocolError>
pub fn negotiate( self, server: ProtocolVersion, ) -> Result<ProtocolVersion, ProtocolError>
Select the highest compatible version in this range.
Trait Implementations§
Source§impl Clone for ProtocolRange
impl Clone for ProtocolRange
impl Copy for ProtocolRange
Source§impl Debug for ProtocolRange
impl Debug for ProtocolRange
Source§impl<'de> Deserialize<'de> for ProtocolRange
impl<'de> Deserialize<'de> for ProtocolRange
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
impl Eq for ProtocolRange
Source§impl PartialEq for ProtocolRange
impl PartialEq for ProtocolRange
Source§impl Serialize for ProtocolRange
impl Serialize for ProtocolRange
impl StructuralPartialEq for ProtocolRange
Auto Trait Implementations§
impl Forget for ProtocolRange
impl Freeze for ProtocolRange
impl RefUnwindSafe for ProtocolRange
impl Send for ProtocolRange
impl Sync for ProtocolRange
impl Unpin for ProtocolRange
impl UnsafeUnpin for ProtocolRange
impl UnwindSafe for ProtocolRange
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.