pub struct FormattingOptions { /* private fields */ }
formatting_options
)dep_bumpalo
only.Expand description
Implementationsยง
Sourceยงimpl FormattingOptions
impl FormattingOptions
Sourcepub const fn new() -> FormattingOptions
๐ฌThis is a nightly-only experimental API. (formatting_options
)Available on crate feature alloc
only.
pub const fn new() -> FormattingOptions
formatting_options
)alloc
only.Construct a new FormatterBuilder
with the supplied Write
trait
object for output that is equivalent to the {}
formatting
specifier:
- no flags,
- filled with spaces,
- no alignment,
- no width,
- no precision, and
- no
DebugAsHex
output mode.
Sourcepub fn sign(&mut self, sign: Option<Sign>) -> &mut FormattingOptions
๐ฌThis is a nightly-only experimental API. (formatting_options
)Available on crate feature alloc
only.
pub fn sign(&mut self, sign: Option<Sign>) -> &mut FormattingOptions
formatting_options
)alloc
only.Sets or removes the sign (the +
or the -
flag).
+
: This is intended for numeric types and indicates that the sign should always be printed. By default only the negative sign of signed values is printed, and the sign of positive or unsigned values is omitted. This flag indicates that the correct sign (+ or -) should always be printed.-
: Currently not used
Sourcepub fn sign_aware_zero_pad(
&mut self,
sign_aware_zero_pad: bool,
) -> &mut FormattingOptions
๐ฌThis is a nightly-only experimental API. (formatting_options
)Available on crate feature alloc
only.
pub fn sign_aware_zero_pad( &mut self, sign_aware_zero_pad: bool, ) -> &mut FormattingOptions
formatting_options
)alloc
only.Sets or unsets the 0
flag.
This is used to indicate for integer formats that the padding to width should both be done with a 0 character as well as be sign-aware
Sourcepub fn alternate(&mut self, alternate: bool) -> &mut FormattingOptions
๐ฌThis is a nightly-only experimental API. (formatting_options
)Available on crate feature alloc
only.
pub fn alternate(&mut self, alternate: bool) -> &mut FormattingOptions
formatting_options
)alloc
only.Sets or unsets the #
flag.
This flag indicates that the โalternateโ form of printing should be used. The alternate forms are:
Sourcepub fn fill(&mut self, fill: char) -> &mut FormattingOptions
๐ฌThis is a nightly-only experimental API. (formatting_options
)Available on crate feature alloc
only.
pub fn fill(&mut self, fill: char) -> &mut FormattingOptions
formatting_options
)alloc
only.Sets the fill character.
The optional fill character and alignment is provided normally in conjunction with the width parameter. This indicates that if the value being formatted is smaller than width some extra characters will be printed around it.
Sourcepub fn align(&mut self, align: Option<Alignment>) -> &mut FormattingOptions
๐ฌThis is a nightly-only experimental API. (formatting_options
)Available on crate feature alloc
only.
pub fn align(&mut self, align: Option<Alignment>) -> &mut FormattingOptions
formatting_options
)alloc
only.Sets or removes the alignment.
The alignment specifies how the value being formatted should be positioned if it is smaller than the width of the formatter.
Sourcepub fn width(&mut self, width: Option<usize>) -> &mut FormattingOptions
๐ฌThis is a nightly-only experimental API. (formatting_options
)Available on crate feature alloc
only.
pub fn width(&mut self, width: Option<usize>) -> &mut FormattingOptions
formatting_options
)alloc
only.Sets or removes the width.
This is a parameter for the โminimum widthโ that the format should take
up. If the valueโs string does not fill up this many characters, then
the padding specified by FormattingOptions::fill
/FormattingOptions::align
will be used to take up the required space.
Sourcepub fn precision(&mut self, precision: Option<usize>) -> &mut FormattingOptions
๐ฌThis is a nightly-only experimental API. (formatting_options
)Available on crate feature alloc
only.
pub fn precision(&mut self, precision: Option<usize>) -> &mut FormattingOptions
formatting_options
)alloc
only.Sets or removes the precision.
- For non-numeric types, this can be considered a โmaximum widthโ. If the resulting string is longer than this width, then it is truncated down to this many characters and that truncated value is emitted with proper fill, alignment and width if those parameters are set.
- For integral types, this is ignored.
- For floating-point types, this indicates how many digits after the decimal point should be printed.
Sourcepub fn debug_as_hex(
&mut self,
debug_as_hex: Option<DebugAsHex>,
) -> &mut FormattingOptions
๐ฌThis is a nightly-only experimental API. (formatting_options
)Available on crate feature alloc
only.
pub fn debug_as_hex( &mut self, debug_as_hex: Option<DebugAsHex>, ) -> &mut FormattingOptions
formatting_options
)alloc
only.Specifies whether the Debug
trait should use lower-/upper-case
hexadecimal or normal integers
Sourcepub const fn get_sign(&self) -> Option<Sign> โ
๐ฌThis is a nightly-only experimental API. (formatting_options
)Available on crate feature alloc
only.
pub const fn get_sign(&self) -> Option<Sign> โ
formatting_options
)alloc
only.Returns the current sign (the +
or the -
flag).
Sourcepub const fn get_sign_aware_zero_pad(&self) -> bool
๐ฌThis is a nightly-only experimental API. (formatting_options
)Available on crate feature alloc
only.
pub const fn get_sign_aware_zero_pad(&self) -> bool
formatting_options
)alloc
only.Returns the current 0
flag.
Sourcepub const fn get_alternate(&self) -> bool
๐ฌThis is a nightly-only experimental API. (formatting_options
)Available on crate feature alloc
only.
pub const fn get_alternate(&self) -> bool
formatting_options
)alloc
only.Returns the current #
flag.
Sourcepub const fn get_fill(&self) -> char
๐ฌThis is a nightly-only experimental API. (formatting_options
)Available on crate feature alloc
only.
pub const fn get_fill(&self) -> char
formatting_options
)alloc
only.Returns the current fill character.
Sourcepub const fn get_align(&self) -> Option<Alignment> โ
๐ฌThis is a nightly-only experimental API. (formatting_options
)Available on crate feature alloc
only.
pub const fn get_align(&self) -> Option<Alignment> โ
formatting_options
)alloc
only.Returns the current alignment.
Sourcepub const fn get_width(&self) -> Option<usize> โ
๐ฌThis is a nightly-only experimental API. (formatting_options
)Available on crate feature alloc
only.
pub const fn get_width(&self) -> Option<usize> โ
formatting_options
)alloc
only.Returns the current width.
Sourcepub const fn get_precision(&self) -> Option<usize> โ
๐ฌThis is a nightly-only experimental API. (formatting_options
)Available on crate feature alloc
only.
pub const fn get_precision(&self) -> Option<usize> โ
formatting_options
)alloc
only.Returns the current precision.
Sourcepub const fn get_debug_as_hex(&self) -> Option<DebugAsHex> โ
๐ฌThis is a nightly-only experimental API. (formatting_options
)Available on crate feature alloc
only.
pub const fn get_debug_as_hex(&self) -> Option<DebugAsHex> โ
formatting_options
)alloc
only.Returns the current precision.
Sourcepub fn create_formatter<'a>(self, write: &'a mut dyn Write) -> Formatter<'a>
๐ฌThis is a nightly-only experimental API. (formatting_options
)Available on crate feature alloc
only.
pub fn create_formatter<'a>(self, write: &'a mut dyn Write) -> Formatter<'a>
formatting_options
)alloc
only.Creates a Formatter
that writes its output to the given Write
trait.
You may alternatively use Formatter::new()
.
Trait Implementationsยง
Sourceยงimpl Clone for FormattingOptions
impl Clone for FormattingOptions
Sourceยงfn clone(&self) -> FormattingOptions
fn clone(&self) -> FormattingOptions
1.0.0 ยท Sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSourceยงimpl Debug for FormattingOptions
impl Debug for FormattingOptions
Sourceยงimpl Default for FormattingOptions
impl Default for FormattingOptions
Sourceยงfn default() -> FormattingOptions
fn default() -> FormattingOptions
Sourceยงimpl PartialEq for FormattingOptions
impl PartialEq for FormattingOptions
impl Copy for FormattingOptions
impl Eq for FormattingOptions
impl StructuralPartialEq for FormattingOptions
Auto Trait Implementationsยง
impl Freeze for FormattingOptions
impl RefUnwindSafe for FormattingOptions
impl Send for FormattingOptions
impl Sync for FormattingOptions
impl Unpin for FormattingOptions
impl UnwindSafe for FormattingOptions
Blanket Implementationsยง
ยงimpl<T> ArchivePointee for T
impl<T> ArchivePointee for T
ยงtype ArchivedMetadata = ()
type ArchivedMetadata = ()
ยงfn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Sourceยงimpl<T> ByteSized for T
impl<T> ByteSized for T
Sourceยงconst BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Sourceยงfn byte_align(&self) -> usize โ
fn byte_align(&self) -> usize โ
Sourceยงfn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Sourceยงimpl<T, R> Chain<R> for Twhere
T: ?Sized,
impl<T, R> Chain<R> for Twhere
T: ?Sized,
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
ยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
ยงfn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Sourceยงimpl<T> ExtAny for T
impl<T> ExtAny for T
Sourceยงfn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Sourceยงimpl<T> ExtMem for Twhere
T: ?Sized,
impl<T> ExtMem for Twhere
T: ?Sized,
Sourceยงconst NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Sourceยงfn mem_align_of<T>() -> usize โ
fn mem_align_of<T>() -> usize โ
Sourceยงfn mem_align_of_val(&self) -> usize โ
fn mem_align_of_val(&self) -> usize โ
Sourceยงfn mem_size_of_val(&self) -> usize โ
fn mem_size_of_val(&self) -> usize โ
Sourceยงfn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true
if dropping values of this type matters. Read moreSourceยงfn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self
without running its destructor. Read moreSourceยงfn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Sourceยงunsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSourceยงunsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSourceยงfn mem_as_bytes(&self) -> &[u8] โ
fn mem_as_bytes(&self) -> &[u8] โ
unsafe_slice
only.ยงimpl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Sourceยงimpl<T> Hook for T
impl<T> Hook for T
ยงimpl<T> Instrument for T
impl<T> Instrument for T
ยงfn instrument(self, span: Span) -> Instrumented<Self> โ
fn instrument(self, span: Span) -> Instrumented<Self> โ
ยงfn in_current_span(self) -> Instrumented<Self> โ
fn in_current_span(self) -> Instrumented<Self> โ
Sourceยงimpl<T> IntoEither for T
impl<T> IntoEither for T
Sourceยงfn into_either(self, into_left: bool) -> Either<Self, Self> โ
fn into_either(self, into_left: bool) -> Either<Self, Self> โ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSourceยงfn into_either_with<F>(self, into_left: F) -> Either<Self, Self> โ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> โ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreยงimpl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
ยงimpl<T> LayoutRaw for T
impl<T> LayoutRaw for T
ยงfn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError> โ
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError> โ
ยงimpl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
ยงunsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
ยงfn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out
indicating that a T
is niched.