pub struct NonZeroFileSize { /* private fields */ }Expand description
A non-zero file size representation
一个表示非零文件大小的结构体。
Implementations§
Source§impl NonZeroFileSize
impl NonZeroFileSize
Sourcepub fn new(bytes: NonZeroU64) -> Self
pub fn new(bytes: NonZeroU64) -> Self
Create a new FileSize instance
创建一个新的 FileSize 实例
Sourcepub fn get_nonzero(&self) -> NonZeroU64
pub fn get_nonzero(&self) -> NonZeroU64
Get the inner NonZeroU64 byte value
获取内部的 NonZeroU64 字节值
Trait Implementations§
Source§impl Clone for NonZeroFileSize
impl Clone for NonZeroFileSize
Source§fn clone(&self) -> NonZeroFileSize
fn clone(&self) -> NonZeroFileSize
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 NonZeroFileSize
impl Debug for NonZeroFileSize
Source§impl FileSizeFormat for NonZeroFileSize
impl FileSizeFormat for NonZeroFileSize
Source§fn get_si_parts(&self) -> (String, &'static str)
fn get_si_parts(&self) -> (String, &'static str)
Returns the formatted value and unit in SI (base-1000) standard
The formatted_value is returned as String to ensure correct decimal places (e.g., “1.00”)
返回 SI (base-1000) 标准的 (formatted_value, unit)
formatted_value 作为 String 返回,以保证正确的小数位数 (例如 “1.00”)
Source§fn get_iec_parts(&self) -> (String, &'static str)
fn get_iec_parts(&self) -> (String, &'static str)
Returns the formatted value and unit in IEC (base-1024) standard
The formatted_value is returned as String to ensure correct decimal places (e.g., “1.00”)
返回 IEC (base-1024) 标准的 (formatted_value, unit)
formatted_value 作为 String 返回,以保证正确的小数位数 (例如 “1.00”)
Source§fn to_si_string(&self) -> String
fn to_si_string(&self) -> String
Returns a formatted string in SI (base-1000) standard Read more
Source§fn to_iec_string(&self) -> String
fn to_iec_string(&self) -> String
Returns a formatted string in IEC (base-1024) standard Read more
Source§impl From<NonZeroFileSize> for FileSize
impl From<NonZeroFileSize> for FileSize
Source§fn from(size: NonZeroFileSize) -> Self
fn from(size: NonZeroFileSize) -> Self
Converts to this type from the input type.
Source§impl Ord for NonZeroFileSize
impl Ord for NonZeroFileSize
Source§fn cmp(&self, other: &NonZeroFileSize) -> Ordering
fn cmp(&self, other: &NonZeroFileSize) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for NonZeroFileSize
impl PartialEq for NonZeroFileSize
Source§impl PartialOrd for NonZeroFileSize
impl PartialOrd for NonZeroFileSize
Source§impl TryFrom<FileSize> for NonZeroFileSize
impl TryFrom<FileSize> for NonZeroFileSize
impl Copy for NonZeroFileSize
impl Eq for NonZeroFileSize
impl StructuralPartialEq for NonZeroFileSize
Auto Trait Implementations§
impl Freeze for NonZeroFileSize
impl RefUnwindSafe for NonZeroFileSize
impl Send for NonZeroFileSize
impl Sync for NonZeroFileSize
impl Unpin for NonZeroFileSize
impl UnwindSafe for NonZeroFileSize
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