pub struct NumberFormattingOptions<'a> {
    pub prefix: &'a str,
    pub suffix: &'a str,
    pub digit_separator: &'a str,
    pub digit_group_size: u8,
    pub number_base: NumberBase,
    pub uppercase_hex: bool,
    pub small_hex_numbers_in_decimal: bool,
    pub add_leading_zero_to_hex_numbers: bool,
    pub leading_zeros: bool,
    pub signed_number: bool,
    pub displacement_leading_zeros: bool,
}
Expand description

Gets initialized with the default options and can be overridden by a FormatterOptionsProvider

Fields§

§prefix: &'a str

Number prefix or an empty string

§suffix: &'a str

Number suffix or an empty string

§digit_separator: &'a str

Digit separator or an empty string to not use a digit separator

§digit_group_size: u8

Size of a digit group or 0 to not use a digit separator

§number_base: NumberBase

Number base

§uppercase_hex: bool

Use uppercase hex digits

§small_hex_numbers_in_decimal: bool

Small hex numbers (-9 .. 9) are shown in decimal

§add_leading_zero_to_hex_numbers: bool

Add a leading zero to hex numbers if there’s no prefix and the number starts with hex digits A-F

§leading_zeros: bool

If true, add leading zeros to numbers, eg. 1h vs 00000001h

§signed_number: bool

If true, the number is signed, and if false it’s an unsigned number

§displacement_leading_zeros: bool

Add leading zeros to displacements

Implementations§

source§

impl<'a> NumberFormattingOptions<'a>

source

pub fn with_immediate(options: &'a FormatterOptions) -> Self

Creates options used when formatting immediate values

Arguments
  • options: Formatter options to use
source

pub fn with_displacement(options: &'a FormatterOptions) -> Self

Creates options used when formatting displacements

Arguments
  • options: Formatter options to use
source

pub fn with_branch(options: &'a FormatterOptions) -> Self

Creates options used when formatting branch operands

Arguments
  • options: Formatter options to use
source

pub fn new( options: &'a FormatterOptions, leading_zeros: bool, signed_number: bool, displacement_leading_zeros: bool ) -> Self

Constructor

Arguments
  • options: Formatter options to use
  • leading_zeros: Add leading zeros to numbers, eg. 1h vs 00000001h
  • signed_number: Signed numbers if true, and unsigned numbers if false
  • displacement_leading_zeros: Add leading zeros to displacements

Trait Implementations§

source§

impl<'a> Clone for NumberFormattingOptions<'a>

source§

fn clone(&self) -> NumberFormattingOptions<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for NumberFormattingOptions<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Default for NumberFormattingOptions<'a>

source§

fn default() -> NumberFormattingOptions<'a>

Returns the “default value” for a type. Read more
source§

impl<'a> Copy for NumberFormattingOptions<'a>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.