Struct clippy_utils::macros::FormatSpec
source · pub struct FormatSpec<'tcx> {
pub fill: Option<char>,
pub align: Alignment,
pub flags: u32,
pub precision: Count<'tcx>,
pub width: Count<'tcx>,
pub trait: Symbol,
pub trait_span: Option<Span>,
}
Expand description
Specification for the formatting of an argument in the format string. See https://doc.rust-lang.org/std/fmt/index.html#formatting-parameters for the precise meanings.
Fields
fill: Option<char>
Optionally specified character to fill alignment with.
align: Alignment
Optionally specified alignment.
flags: u32
Packed version of various flags provided, see rustc_parse_format::Flag
.
precision: Count<'tcx>
Represents either the maximum width or the integer precision.
width: Count<'tcx>
The minimum width, will be padded according to width
/align
trait: Symbol
The formatting trait used by the argument, e.g. sym::Display
for {}
, sym::Debug
for
{:?}
.
trait_span: Option<Span>
Implementations
sourceimpl<'tcx> FormatSpec<'tcx>
impl<'tcx> FormatSpec<'tcx>
fn new(
spec: FormatSpec<'_>,
positions: ParamPosition,
values: &FormatArgsValues<'tcx>
) -> Option<Self>
sourcepub fn has_string_formatting(&self) -> bool
pub fn has_string_formatting(&self) -> bool
Returns true if this format spec would change the contents of a string when formatted
Trait Implementations
Auto Trait Implementations
impl<'tcx> RefUnwindSafe for FormatSpec<'tcx>
impl<'tcx> !Send for FormatSpec<'tcx>
impl<'tcx> !Sync for FormatSpec<'tcx>
impl<'tcx> Unpin for FormatSpec<'tcx>
impl<'tcx> UnwindSafe for FormatSpec<'tcx>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 96 bytes