Struct alpm_types::CompressedSize
source · pub struct CompressedSize(pub u64);
Expand description
Compressed size of a file (in bytes)
§Examples
use alpm_types::{CompressedSize, Error};
use std::str::FromStr;
// create CompressedSize from &str
assert_eq!(
CompressedSize::from_str("1"),
Ok(CompressedSize(1))
);
assert_eq!(
CompressedSize::from_str("-1"),
Err(Error::InvalidCompressedSize(String::from("-1")))
);
// format as String
assert_eq!("1", format!("{}", CompressedSize(1)));
Tuple Fields§
§0: u64
Trait Implementations§
source§impl Clone for CompressedSize
impl Clone for CompressedSize
source§fn clone(&self) -> CompressedSize
fn clone(&self) -> CompressedSize
Returns a copy of the value. Read more
1.0.0 · 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 CompressedSize
impl Debug for CompressedSize
source§impl Display for CompressedSize
impl Display for CompressedSize
source§impl FromStr for CompressedSize
impl FromStr for CompressedSize
source§impl PartialEq for CompressedSize
impl PartialEq for CompressedSize
source§fn eq(&self, other: &CompressedSize) -> bool
fn eq(&self, other: &CompressedSize) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for CompressedSize
impl Eq for CompressedSize
impl StructuralPartialEq for CompressedSize
Auto Trait Implementations§
impl Freeze for CompressedSize
impl RefUnwindSafe for CompressedSize
impl Send for CompressedSize
impl Sync for CompressedSize
impl Unpin for CompressedSize
impl UnwindSafe for CompressedSize
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