pub struct ServerVersion { /* private fields */ }Expand description
A parsed server version with comparison support.
Hyper server versions typically follow the format major.minor.patch,
sometimes with additional build metadata (e.g., 0.0.19038.r12345).
§Ordering
Versions are compared lexicographically by (major, minor, patch).
The suffix field is ignored for comparison and ordering.
Implementations§
Source§impl ServerVersion
impl ServerVersion
Sourcepub fn new(major: u32, minor: u32, patch: u32) -> Self
pub fn new(major: u32, minor: u32, patch: u32) -> Self
Creates a new ServerVersion from components.
Sourcepub fn parse(s: &str) -> Option<Self>
pub fn parse(s: &str) -> Option<Self>
Parses a version string like “0.0.19038” or “1.2.3.r456”.
Accepts various production formats:
"0.0.19038"— standard dotted numeric"1.2.3.r456"— dot-separated suffix"1.2.3-beta1"— hyphen-separated pre-release"v1.2.3"— optionalv/Vprefix"1.2"— patch defaults to 0" 1.2.3 "— leading/trailing whitespace is trimmed
Returns None if the string doesn’t contain at least two numeric
components separated by a dot.
Trait Implementations§
Source§impl Clone for ServerVersion
impl Clone for ServerVersion
Source§fn clone(&self) -> ServerVersion
fn clone(&self) -> ServerVersion
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 moreSource§impl Debug for ServerVersion
impl Debug for ServerVersion
Source§impl Display for ServerVersion
impl Display for ServerVersion
Source§impl Ord for ServerVersion
impl Ord for ServerVersion
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
Source§impl PartialEq for ServerVersion
impl PartialEq for ServerVersion
Source§fn eq(&self, other: &ServerVersion) -> bool
fn eq(&self, other: &ServerVersion) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ServerVersion
impl PartialOrd for ServerVersion
impl Eq for ServerVersion
impl StructuralPartialEq for ServerVersion
Auto Trait Implementations§
impl Freeze for ServerVersion
impl RefUnwindSafe for ServerVersion
impl Send for ServerVersion
impl Sync for ServerVersion
impl Unpin for ServerVersion
impl UnsafeUnpin for ServerVersion
impl UnwindSafe for ServerVersion
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request