Struct alpm_types::InstalledSize
source · pub struct InstalledSize { /* private fields */ }Expand description
Installed size of a package (in bytes)
Examples
use alpm_types::{InstalledSize, Error};
use std::str::FromStr;
// create InstalledSize from &str
assert_eq!(InstalledSize::from_str("1"), Ok(InstalledSize::new(1)));
assert_eq!(
InstalledSize::from_str("-1"),
Err(Error::InvalidInstalledSize(String::from("-1")))
);
// format as String
assert_eq!("1", format!("{}", InstalledSize::new(1)));Implementations§
source§impl InstalledSize
impl InstalledSize
sourcepub fn new(size: u64) -> InstalledSize
pub fn new(size: u64) -> InstalledSize
Create a new InstalledSize
Trait Implementations§
source§impl Clone for InstalledSize
impl Clone for InstalledSize
source§fn clone(&self) -> InstalledSize
fn clone(&self) -> InstalledSize
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 InstalledSize
impl Debug for InstalledSize
source§impl Display for InstalledSize
impl Display for InstalledSize
source§impl FromStr for InstalledSize
impl FromStr for InstalledSize
source§impl PartialEq<InstalledSize> for InstalledSize
impl PartialEq<InstalledSize> for InstalledSize
source§fn eq(&self, other: &InstalledSize) -> bool
fn eq(&self, other: &InstalledSize) -> bool
This method tests for
self and other values to be equal, and is used
by ==.