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::from_str("1").is_ok());
assert!(Epoch::from_str("0").is_err());
Tuple Fields§
§0: NonZeroUsize
Implementations§
Trait Implementations§
source§impl Ord for Epoch
impl Ord for Epoch
source§impl PartialOrd for Epoch
impl PartialOrd for Epoch
impl 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)