Struct size_format::SizeFormatter [−][src]
pub struct SizeFormatter<BaseType, Prefix, Separator> where
BaseType: Clone + Integer + Display + FromPrimitive + Pow<u32, Output = BaseType>,
Ratio<BaseType>: FromPrimitive,
Prefix: PrefixType,
Separator: DecimalSeparator, { /* fields omitted */ }
Represents a size that can be formatted.
Panics
- May panic if the
BaseType
is too small for the prefix specified inPrefix
and the number is being formatted.
Methods
impl<BaseType, Prefix, Separator> SizeFormatter<BaseType, Prefix, Separator> where
BaseType: Clone + Integer + Display + FromPrimitive + Pow<u32, Output = BaseType>,
Ratio<BaseType>: FromPrimitive,
Prefix: PrefixType,
Separator: DecimalSeparator,
[src]
impl<BaseType, Prefix, Separator> SizeFormatter<BaseType, Prefix, Separator> where
BaseType: Clone + Integer + Display + FromPrimitive + Pow<u32, Output = BaseType>,
Ratio<BaseType>: FromPrimitive,
Prefix: PrefixType,
Separator: DecimalSeparator,
pub fn new(num: BaseType) -> SizeFormatter<BaseType, Prefix, Separator>
[src]
pub fn new(num: BaseType) -> SizeFormatter<BaseType, Prefix, Separator>
Creates a new size formatter for the given number.
pub fn from<T: Into<BaseType>>(
num: T
) -> SizeFormatter<BaseType, Prefix, Separator>
[src]
pub fn from<T: Into<BaseType>>(
num: T
) -> SizeFormatter<BaseType, Prefix, Separator>
Creates a new size formatter from a compatible number.
Trait Implementations
impl<BaseType, Prefix, Separator> Display for SizeFormatter<BaseType, Prefix, Separator> where
BaseType: Clone + Integer + Display + FromPrimitive + Pow<u32, Output = BaseType>,
Ratio<BaseType>: FromPrimitive,
Prefix: PrefixType,
Separator: DecimalSeparator,
[src]
impl<BaseType, Prefix, Separator> Display for SizeFormatter<BaseType, Prefix, Separator> where
BaseType: Clone + Integer + Display + FromPrimitive + Pow<u32, Output = BaseType>,
Ratio<BaseType>: FromPrimitive,
Prefix: PrefixType,
Separator: DecimalSeparator,
Auto Trait Implementations
impl<BaseType, Prefix, Separator> Send for SizeFormatter<BaseType, Prefix, Separator> where
BaseType: Send,
Prefix: Send,
Separator: Send,
impl<BaseType, Prefix, Separator> Send for SizeFormatter<BaseType, Prefix, Separator> where
BaseType: Send,
Prefix: Send,
Separator: Send,
impl<BaseType, Prefix, Separator> Sync for SizeFormatter<BaseType, Prefix, Separator> where
BaseType: Sync,
Prefix: Sync,
Separator: Sync,
impl<BaseType, Prefix, Separator> Sync for SizeFormatter<BaseType, Prefix, Separator> where
BaseType: Sync,
Prefix: Sync,
Separator: Sync,