pub struct ProtocolVersion {
pub major: u16,
pub minor: u16,
}Fields§
§major: u16§minor: u16Implementations§
Source§impl ProtocolVersion
impl ProtocolVersion
pub const V3_0: Self
pub const V3_2: Self
pub const LATEST: Self = Self::V3_2
pub fn from_raw(raw: i32) -> Self
pub const fn raw(self) -> i32
Sourcepub fn negotiate(self) -> Result<Self, PgWireError>
pub fn negotiate(self) -> Result<Self, PgWireError>
Select the newest protocol version this crate supports without negotiating to a version newer than the frontend requested.
Sourcepub fn negotiate_with_max(
self,
newest_supported: Self,
) -> Result<Self, PgWireError>
pub fn negotiate_with_max( self, newest_supported: Self, ) -> Result<Self, PgWireError>
Select a protocol version no newer than either the frontend request or the newest version implemented by the embedding server.
Sourcepub const fn is_supported_server_max(self) -> bool
pub const fn is_supported_server_max(self) -> bool
Versions an embedding server may configure as its implementation
maximum. PostgreSQL 18 has implementations for 3.0 and 3.2; a 3.1
frontend request can remain selected, but 3.1 is not a server maximum.
Trait Implementations§
Source§impl Clone for ProtocolVersion
impl Clone for ProtocolVersion
Source§fn clone(&self) -> ProtocolVersion
fn clone(&self) -> ProtocolVersion
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ProtocolVersion
Source§impl Debug for ProtocolVersion
impl Debug for ProtocolVersion
impl Eq for ProtocolVersion
Source§impl Ord for ProtocolVersion
impl Ord for ProtocolVersion
Source§fn cmp(&self, other: &ProtocolVersion) -> Ordering
fn cmp(&self, other: &ProtocolVersion) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for ProtocolVersion
impl PartialEq for ProtocolVersion
Source§impl PartialOrd for ProtocolVersion
impl PartialOrd for ProtocolVersion
impl StructuralPartialEq for ProtocolVersion
Auto Trait Implementations§
impl Freeze for ProtocolVersion
impl RefUnwindSafe for ProtocolVersion
impl Send for ProtocolVersion
impl Sync for ProtocolVersion
impl Unpin for ProtocolVersion
impl UnsafeUnpin for ProtocolVersion
impl UnwindSafe for ProtocolVersion
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