pub struct FloatFormat<'a>(/* private fields */);Expand description
A validated floating-point format for ImPlot values.
ImPlot promotes the corresponding values to double before formatting.
Unlike core Dear ImGui numeric widgets, ImPlot forwards the complete format
to native printf paths, so this type also requires ASCII text. Use an axis
formatter closure when localized or arbitrary UTF-8 output is required.
Implementations§
Source§impl<'a> FloatFormat<'a>
impl<'a> FloatFormat<'a>
Sourcepub fn new(storage: impl Into<Cow<'a, str>>) -> Result<Self, FloatFormatError>
pub fn new(storage: impl Into<Cow<'a, str>>) -> Result<Self, FloatFormatError>
Validates a floating-point format accepted by ImPlot’s native formatters.
Sourcepub fn borrowed(&self) -> FloatFormat<'_>
pub fn borrowed(&self) -> FloatFormat<'_>
Borrows this format without revalidating it.
Sourcepub fn into_owned(self) -> FloatFormat<'static>
pub fn into_owned(self) -> FloatFormat<'static>
Converts this format into an owned value.
Sourcepub fn into_numeric_format(self) -> NumericFormat<'a, f64>
pub fn into_numeric_format(self) -> NumericFormat<'a, f64>
Returns the underlying typed Dear ImGui numeric format.
Trait Implementations§
Source§impl AsRef<str> for FloatFormat<'_>
impl AsRef<str> for FloatFormat<'_>
Source§impl<'a> Clone for FloatFormat<'a>
impl<'a> Clone for FloatFormat<'a>
Source§fn clone(&self) -> FloatFormat<'a>
fn clone(&self) -> FloatFormat<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for FloatFormat<'a>
impl<'a> Debug for FloatFormat<'a>
Source§impl FromStr for FloatFormat<'static>
impl FromStr for FloatFormat<'static>
Source§impl<'a> PartialEq for FloatFormat<'a>
impl<'a> PartialEq for FloatFormat<'a>
impl<'a> StructuralPartialEq for FloatFormat<'a>
Source§impl<'a> TryFrom<&'a str> for FloatFormat<'a>
impl<'a> TryFrom<&'a str> for FloatFormat<'a>
Source§impl<'a> TryFrom<FloatFormat<'a>> for AxisFormat<'a>
impl<'a> TryFrom<FloatFormat<'a>> for AxisFormat<'a>
Source§type Error = AxisFormatError
type Error = AxisFormatError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl<'a> Freeze for FloatFormat<'a>
impl<'a> RefUnwindSafe for FloatFormat<'a>
impl<'a> Send for FloatFormat<'a>
impl<'a> Sync for FloatFormat<'a>
impl<'a> Unpin for FloatFormat<'a>
impl<'a> UnsafeUnpin for FloatFormat<'a>
impl<'a> UnwindSafe for FloatFormat<'a>
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