Struct postgresql_archive::Version
source · pub struct Version {
pub major: u64,
pub minor: Option<u64>,
pub release: Option<u64>,
}
Expand description
PostgreSQL version struct. The version is a simple wrapper around a string. Actively supported major versions of PostgreSQL are defined as constants. The oldest supported version is will be marked as deprecated. Deprecated versions will be removed in a future release following semver conventions for this crate.
Fields§
§major: u64
§minor: Option<u64>
§release: Option<u64>
Implementations§
source§impl Version
impl Version
pub const fn new(major: u64, minor: Option<u64>, release: Option<u64>) -> Self
sourcepub fn matches(&self, version: &Version) -> bool
pub fn matches(&self, version: &Version) -> bool
Matches the version against another version. Provides a simple way to match
against a major, major/minor, or major/minor/release version. Returns true
if the major version matches and the minor version matches or is not specified.
Returns true
if the major and minor versions match and the release matches or
is not specified. Returns false
otherwise.
§Examples
The methods of this trait must be consistent with each other and with those of PartialEq
.
The following conditions must hold:
16
matches16.1.0
,16.1.1
,16.2.0
, etc.16.1
matches16.1.0
,16.1.1
, etc.16.1.0
matches only16.1.0
15
does not match16.1.0
16.0
does not match16.1.0
16.1.0
does not match16.1.1
Trait Implementations§
source§impl<'de> Deserialize<'de> for Version
impl<'de> Deserialize<'de> for Version
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>,
source§impl PartialEq for Version
impl PartialEq for Version
source§impl PartialOrd for Version
impl PartialOrd for Version
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more