Struct alpm_types::Epoch
source · pub struct Epoch(pub NonZeroUsize);
Expand description
An epoch of a package
Epoch is used to indicate the downgrade of a package and is prepended to a version, delimited by a ":"
(e.g. 1:
is added to 0.10.0-1
to form 1:0.10.0-1
which then orders newer than 1.0.0-1
).
An Epoch wraps a usize that is guaranteed to be greater than 0
.
§Examples
use std::str::FromStr;
use alpm_types::Epoch;
assert!(Epoch::new("1").is_ok());
assert!(Epoch::new("0").is_err());
Tuple Fields§
§0: NonZeroUsize
Implementations§
Trait Implementations§
source§impl Ord for Epoch
impl Ord for Epoch
source§impl PartialEq for Epoch
impl PartialEq for Epoch
source§impl PartialOrd for Epoch
impl PartialOrd for Epoch
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Epoch
impl Eq for Epoch
impl StructuralPartialEq for Epoch
Auto Trait Implementations§
impl Freeze for Epoch
impl RefUnwindSafe for Epoch
impl Send for Epoch
impl Sync for Epoch
impl Unpin for Epoch
impl UnwindSafe for Epoch
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