pub struct DownloadSpeed { /* private fields */ }Expand description
Download speed in bytes per second
表示下载速度(单位:字节每秒)
Implementations§
Source§impl DownloadSpeed
impl DownloadSpeed
Sourcepub fn from_raw(bytes_per_second: NonZeroU64, standard: SizeStandard) -> Self
pub fn from_raw(bytes_per_second: NonZeroU64, standard: SizeStandard) -> Self
Sourcepub fn new(
bytes: NonZeroU64,
duration: Duration,
standard: SizeStandard,
) -> Self
pub fn new( bytes: NonZeroU64, duration: Duration, standard: SizeStandard, ) -> Self
Sourcepub fn as_decimal(&self) -> Decimal
pub fn as_decimal(&self) -> Decimal
Get the speed in bytes per second as a Decimal
以 Decimal 的形式获取字节每秒
Sourcepub fn as_u64(&self) -> u64
pub fn as_u64(&self) -> u64
Get the speed in bytes per second as u64 (floored)
以 u64 的形式获取字节每秒(向下取整)
Sourcepub fn get_si_parts(&self) -> (String, &'static str)
pub fn get_si_parts(&self) -> (String, &'static str)
Returns the formatted value and unit in SI (base-1000) standard
返回 SI (base-1000) 标准的 (formatted_value, unit)
Sourcepub fn get_iec_parts(&self) -> (String, &'static str)
pub fn get_iec_parts(&self) -> (String, &'static str)
Returns the formatted value and unit in IEC (base-1024) standard
返回 IEC (base-1024) 标准的 (formatted_value, unit)
Trait Implementations§
Source§impl Clone for DownloadSpeed
impl Clone for DownloadSpeed
Source§fn clone(&self) -> DownloadSpeed
fn clone(&self) -> DownloadSpeed
Returns a duplicate 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 DownloadSpeed
impl Debug for DownloadSpeed
Source§impl Display for DownloadSpeed
impl Display for DownloadSpeed
Source§impl PartialEq for DownloadSpeed
impl PartialEq for DownloadSpeed
Source§impl PartialOrd for DownloadSpeed
impl PartialOrd for DownloadSpeed
impl Copy for DownloadSpeed
Auto Trait Implementations§
impl Freeze for DownloadSpeed
impl RefUnwindSafe for DownloadSpeed
impl Send for DownloadSpeed
impl Sync for DownloadSpeed
impl Unpin for DownloadSpeed
impl UnwindSafe for DownloadSpeed
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