pub struct Arguments<'fmt, Context>(pub &'fmt [Argument<'fmt, Context>]);Expand description
Sequence of objects that should be formatted in the specified order.
The format_args! macro will safely create an instance of this structure.
You can use the Arguments<a> that format_args! return in Format context as seen below.
It will call the format function for each of its objects.
use ruff_formatter::prelude::*;
use ruff_formatter::{format, format_args};
let formatted = format!(SimpleFormatContext::default(), [
format_args!(token("a"), space(), token("b"))
])?;
assert_eq!("a b", formatted.print()?.as_code());Tuple Fields§
§0: &'fmt [Argument<'fmt, Context>]Trait Implementations§
impl<Context> Copy for Arguments<'_, Context>
Auto Trait Implementations§
impl<'fmt, Context> !RefUnwindSafe for Arguments<'fmt, Context>
impl<'fmt, Context> !Send for Arguments<'fmt, Context>
impl<'fmt, Context> !Sync for Arguments<'fmt, Context>
impl<'fmt, Context> !UnwindSafe for Arguments<'fmt, Context>
impl<'fmt, Context> Freeze for Arguments<'fmt, Context>
impl<'fmt, Context> Unpin for Arguments<'fmt, Context>
impl<'fmt, Context> UnsafeUnpin for Arguments<'fmt, Context>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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