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.
source§impl From<Locale> for CustomFormatBuilder
impl From<Locale> for CustomFormatBuilder
source§impl Hash for CustomFormatBuilder
impl Hash for CustomFormatBuilder
source§impl PartialEq<CustomFormatBuilder> for CustomFormatBuilder
impl PartialEq<CustomFormatBuilder> for CustomFormatBuilder
source§fn eq(&self, other: &CustomFormatBuilder) -> bool
fn eq(&self, other: &CustomFormatBuilder) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for CustomFormatBuilder
impl StructuralEq for CustomFormatBuilder
impl StructuralPartialEq for CustomFormatBuilder
Auto Trait Implementations§
impl RefUnwindSafe for CustomFormatBuilder
impl Send for CustomFormatBuilder
impl Sync for CustomFormatBuilder
impl Unpin for CustomFormatBuilder
impl UnwindSafe for CustomFormatBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more