Struct num_format::CustomFormatBuilder
source · pub struct CustomFormatBuilder { /* private fields */ }
Expand description
Type for building CustomFormat
s.
Implementations§
source§impl CustomFormatBuilder
impl CustomFormatBuilder
sourcepub fn build(self) -> Result<CustomFormat, Error>
pub fn build(self) -> Result<CustomFormat, Error>
Construct a CustomFormat
.
Errors
Return an error if:
- The “decimal” is longer than 8 bytes
- The “infinity sign” is longer than 128 bytes
- The “minus sign” is longer than 8 bytes
- The “nan symbol” is longer than 64 bytes
- The “plus sign” is longer than 8 bytes
- The “separator” is longer than 8 bytes
sourcepub fn decimal<S>(self, s: S) -> Selfwhere
S: AsRef<str>,
pub fn decimal<S>(self, s: S) -> Selfwhere
S: AsRef<str>,
Sets the character used to represent decimal points.
sourcepub fn format<F>(self, value: &F) -> Selfwhere
F: Format,
pub fn format<F>(self, value: &F) -> Selfwhere
F: Format,
Sets all fields based on the provided format.
sourcepub fn infinity<S>(self, s: S) -> Selfwhere
S: AsRef<str>,
pub fn infinity<S>(self, s: S) -> Selfwhere
S: AsRef<str>,
Sets the string representation of infinity.
sourcepub fn minus_sign<S>(self, s: S) -> Selfwhere
S: AsRef<str>,
pub fn minus_sign<S>(self, s: S) -> Selfwhere
S: AsRef<str>,
Sets the string representation of a minus sign.
Trait Implementations§
source§impl Clone for CustomFormatBuilder
impl Clone for CustomFormatBuilder
source§fn clone(&self) -> CustomFormatBuilder
fn clone(&self) -> CustomFormatBuilder
Returns a copy 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 CustomFormatBuilder
impl Debug for CustomFormatBuilder
source§impl From<CustomFormat> for CustomFormatBuilder
impl From<CustomFormat> for CustomFormatBuilder
source§fn from(format: CustomFormat) -> Self
fn from(format: CustomFormat) -> Self
Converts to this type from the input type.