pub fn from_total_bytes(total_bytes: u64) -> Self {
        let b = total_bytes;

        let pb = b / PB;
        let b = b - pb * PB;

        let tb = b / TB;
        let b = b - tb * TB;
        let gb = b / GB;
        let b = b - gb * GB;

        let mb = b / MB;
        let b = b - mb * MB;
        let kb = b / KB;
        let b = b - kb * KB;

        Self {
            pb: pb as u16,
            tb: tb as u16,
            gb: gb as u16,
            mb: mb as u16,
            kb: kb as u16,
            b: b as u16,
        }
    }
/// Returns a new `FileSize` with representing given number of bytes
///
/// This produces a `FileSize` with optimal values for each count
/// field. In other words, the largest possible units are filled 
/// first, rather than just setting the bytes field to the input.
///
/// # Arguments
///
/// * `total_bytes` - The number of bytes the new `FileSize` should represent
///
/// # Examples
///
/// ```
/// use zeus_fm::zeuslib::utils::fs::FileSize;
///
/// const b: u64 = 1048726;
///
/// let fs = FileSize::from_total_bytes(b);
///
/// assert_eq!(fs.pb, 0);
/// assert_eq!(fs.tb, 0);
/// assert_eq!(fs.gb, 0);
/// assert_eq!(fs.mb, 1);
/// assert_eq!(fs.kb, 0);
/// assert_eq!(fs.b, 150);
/// ```
///
Returns a new `FileSize` with representing given number of bytes
This produces a `FileSize` with optimal values for each count
field. In other words, the largest possible units are filled
first, rather than just setting the bytes field to the input.
Returns a new ` FileSize ` with representing given number of bytes This produces a ` FileSize ` with optimal values for each count field . In other words the largest possible units are filled first rather than just setting the bytes field to the input .
pub fn from_total_bytes(total_bytes: u64) -> Self {
        let b = total_bytes;
        let pb = b / PB;
        let b = b - pb * PB;
        let tb = b / TB;
        let b = b - tb * TB;
        let gb = b / GB;
        let b = b - gb * GB;
        let mb = b / MB;
        let b = b - mb * MB;
        let kb = b / KB;
        let b = b - kb * KB;
        Self {
            pb: pb as u16,
            tb: tb as u16,
            gb: gb as u16,
            mb: mb as u16,
            kb: kb as u16,
            b: b as u16,
        }
    }
pub fn from_total_bytes ( total_bytes : u64 ) -> Self { let b = total_bytes ; let pb = b / PB ; let b = b - pb * PB ; let tb = b / TB ; let b = b - tb * TB ; let gb = b / GB ; let b = b - gb * GB ; let mb = b / MB ; let b = b - mb * MB ; let kb = b / KB ; let b = b - kb * KB ; Self { pb : pb as u16 , tb : tb as u16 , gb : gb as u16 , mb : mb as u16 , kb : kb as u16 , b : b as u16 , } }
Returns a new `FileSize` with representing given number of bytes
This produces a `FileSize` with optimal values for each count
field.
Returns a new ` FileSize ` with representing given number of bytes This produces a ` FileSize ` with optimal values for each count field .
total_bytes
u64
total_bytes
u64
examples
```
use zeus_fm::zeuslib::utils::fs::FileSize.



let fs = FileSize::from_total_bytes(b).


` ` ` use zeus_fm :: zeuslib :: utils :: fs :: FileSize . let fs = FileSize :: from_total_bytes ( b ) .