pub struct GlibcVersion {
pub major: u32,
pub minor: u32,
pub patch: u32,
}Expand description
A GLIBC_x.y release the host’s libc must reach for an artifact to
load. Three components because real tags carry one when they need it —
GLIBC_2.2.5 exists — and 2.2 < 2.2.5 must not hold.
Fields§
§major: u32The major component — 2 for every glibc release in the wild.
minor: u32The minor component.
patch: u32The patch component, 0 when the tag carries only major.minor.
Implementations§
Source§impl GlibcVersion
impl GlibcVersion
Sourcepub fn parse_version_tag(name: &[u8]) -> Option<Self>
pub fn parse_version_tag(name: &[u8]) -> Option<Self>
Parse one GLIBC_x.y[.z] version-needed name — the bytes an ELF
SHT_GNU_VERNEED aux entry names, like b"GLIBC_2.28". Returns
None for anything else: other namespaces (GCC_3.0,
GLIBCXX_3.4.29), and glibc’s own non-numeric names
(GLIBC_PRIVATE, GLIBC_ABI_DT_RELR) that pin an ABI property
rather than a release.
Trait Implementations§
Source§impl Clone for GlibcVersion
impl Clone for GlibcVersion
impl Copy for GlibcVersion
Source§impl Debug for GlibcVersion
impl Debug for GlibcVersion
Source§impl<'de> Deserialize<'de> for GlibcVersion
impl<'de> Deserialize<'de> for GlibcVersion
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Source§impl Display for GlibcVersion
major.minor, plus .patch only when nonzero — 2.28, 2.2.5.
The bare two-component rendering is the form every existing release
tag and the gnu_get_libc_version string share.
impl Display for GlibcVersion
major.minor, plus .patch only when nonzero — 2.28, 2.2.5.
The bare two-component rendering is the form every existing release
tag and the gnu_get_libc_version string share.
impl Eq for GlibcVersion
Source§impl FromStr for GlibcVersion
"{major}.{minor}[.{patch}]" — the same shape [Display] writes, so
GlibcVersion::from_str(v.to_string().as_str()) round-trips. Anything
else — empty components, non-digits, a fourth component — fails.
impl FromStr for GlibcVersion
"{major}.{minor}[.{patch}]" — the same shape [Display] writes, so
GlibcVersion::from_str(v.to_string().as_str()) round-trips. Anything
else — empty components, non-digits, a fourth component — fails.
Source§impl Hash for GlibcVersion
impl Hash for GlibcVersion
Source§impl Ord for GlibcVersion
impl Ord for GlibcVersion
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for GlibcVersion
impl PartialEq for GlibcVersion
Source§impl PartialOrd for GlibcVersion
impl PartialOrd for GlibcVersion
Source§impl Serialize for GlibcVersion
Wire form is the Display string: "2.28", not a two-field object —
the row reads like a version, not a struct.
impl Serialize for GlibcVersion
Wire form is the Display string: "2.28", not a two-field object —
the row reads like a version, not a struct.
impl StructuralPartialEq for GlibcVersion
Auto Trait Implementations§
impl Freeze for GlibcVersion
impl RefUnwindSafe for GlibcVersion
impl Send for GlibcVersion
impl Sync for GlibcVersion
impl Unpin for GlibcVersion
impl UnsafeUnpin for GlibcVersion
impl UnwindSafe for GlibcVersion
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
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
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§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
key and return true if they are equal.