fn format(&self, field: Field) -> String {
        use RenderFormat::*;
        match &self.format {
            Some(format) => match format {
                Precision(precision) => format!("{:.precision$}", field, precision = precision),
                ReadableSize => convert_bytes(f64::from(field)),
                PageReadableSize => convert_bytes(4096.0 * f64::from(field)),
                SectorReadableSize => convert_bytes(512.0 * f64::from(field)),
                MaxOrReadableSize => {
                    let field = i64::from(field);
                    if field == -1 {
                        "max".to_owned()
                    } else {
                        convert_bytes(field as f64)
                    }
                }
            },
            None => field.to_string(),
        }
    }
/// Applies format to render a Field into a String.
Applies format to render a Field into a String.
Applies format to render a Field into a String .
fn format(&self, field: Field) -> String {
        use RenderFormat::*;
        match &self.format {
            Some(format) => match format {
                Precision(precision) => format!("{:.precision$}", field, precision = precision),
                ReadableSize => convert_bytes(f64::from(field)),
                PageReadableSize => convert_bytes(4096.0 * f64::from(field)),
                SectorReadableSize => convert_bytes(512.0 * f64::from(field)),
                MaxOrReadableSize => {
                    let field = i64::from(field);
                    if field == -1 {
                        "max".to_owned()
                    } else {
                        convert_bytes(field as f64)
                    }
                }
            },
            None => field.to_string(),
        }
    }
fn format ( & self , field : Field ) -> String { use RenderFormat :: * ; match & self . format { Some ( format ) => match format { Precision ( precision ) => format ! ( " " field precision precision ) , ReadableSize => convert_bytes ( f64 :: from ( field ) ) , PageReadableSize => convert_bytes ( 4096.0 * f64 :: from ( field ) ) , SectorReadableSize => convert_bytes ( 512.0 * f64 :: from ( field ) ) , MaxOrReadableSize => { let field = i64 :: from ( field ) ; if field == - 1 { " " . to_owned ( ) } else { convert_bytes ( field as f64 ) } } } , None => field . to_string ( ) , } }
Applies format to render a Field into a String.
Applies format to render a Field into a String .
&self
field
Field
&self
field
Field