Struct num_format::CustomFormat [−][src]
pub struct CustomFormat { /* fields omitted */ }
Type for representing your own custom formats. Implements Format
.
Example
use num_format::{Buffer, Error, CustomFormat, Grouping}; fn main() -> Result<(), Error> { let format = CustomFormat::builder() .grouping(Grouping::Indian) .minus_sign("🙌") .separator("😀") .build()?; let mut buf = Buffer::new(); buf.write_formatted(&(-1000000), &format); assert_eq!("🙌10😀00😀000", buf.as_str()); Ok(()) }
Implementations
impl CustomFormat
[src]
impl CustomFormat
[src]pub fn builder() -> CustomFormatBuilder
[src]
Constructs a CustomFormatBuilder
.
pub fn into_builder(self) -> CustomFormatBuilder
[src]
Turns self
into a CustomFormatBuilder
.
pub fn decimal(&self) -> &str
[src]
Returns this format’s representation of decimal points.
pub fn grouping(&self) -> Grouping
[src]
pub fn infinity(&self) -> &str
[src]
Returns this format’s representation of infinity.
pub fn minus_sign(&self) -> &str
[src]
Returns this format’s representation of minus signs.
pub fn nan(&self) -> &str
[src]
Returns this format’s representation of NaN.
pub fn plus_sign(&self) -> &str
[src]
Returns this format’s representation of plus signs.
pub fn separator(&self) -> &str
[src]
Returns this format’s representation of separators.
Trait Implementations
impl Clone for CustomFormat
[src]
impl Clone for CustomFormat
[src]fn clone(&self) -> CustomFormat
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for CustomFormat
[src]
impl Default for CustomFormat
[src]impl Format for CustomFormat
[src]
impl Format for CustomFormat
[src]fn decimal(&self) -> DecimalStr<'_>
[src]
fn grouping(&self) -> Grouping
[src]
fn infinity(&self) -> InfinityStr<'_>
[src]
fn minus_sign(&self) -> MinusSignStr<'_>
[src]
fn nan(&self) -> NanStr<'_>
[src]
fn plus_sign(&self) -> PlusSignStr<'_>
[src]
fn separator(&self) -> SeparatorStr<'_>
[src]
impl From<CustomFormat> for CustomFormatBuilder
[src]
impl From<CustomFormat> for CustomFormatBuilder
[src]fn from(format: CustomFormat) -> Self
[src]
impl Hash for CustomFormat
[src]
impl Hash for CustomFormat
[src]impl PartialEq<CustomFormat> for CustomFormat
[src]
impl PartialEq<CustomFormat> for CustomFormat
[src]