pub enum Position<'a> {
Auto,
Index(usize),
Key(&'a str),
}
Expand description
Refers to an argument within an argument list.
During formatting, the formatter will pull arguments from the argument list. Depending on
whether the argument list supports indexed or named lookups, this might result in an error. See
FormatArgs
for argument list implementations.
A Position may borrow they key name from the format string.
Variants§
Auto
The next indexed argument in line.
The formatter maintains an internal state to keep track of the sequence of auto-arguments. If an interim access to a specific indexed or named argument occurs, the formatter will afterwards continue after the last auto argument.
Requires the argument list to be indexable by numbers.
Index(usize)
Index argument at the given offset.
Requires the argument list to be indexable by numbers.
Key(&'a str)
Named argument with the given key.
Requires the argument list to be indexable by string keys.
Trait Implementations§
Source§impl<'a> Ord for Position<'a>
impl<'a> Ord for Position<'a>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<'a> PartialOrd for Position<'a>
impl<'a> PartialOrd for Position<'a>
impl<'a> Copy for Position<'a>
impl<'a> Eq for Position<'a>
impl<'a> StructuralPartialEq for Position<'a>
Auto Trait Implementations§
impl<'a> Freeze for Position<'a>
impl<'a> RefUnwindSafe for Position<'a>
impl<'a> Send for Position<'a>
impl<'a> Sync for Position<'a>
impl<'a> Unpin for Position<'a>
impl<'a> UnwindSafe for Position<'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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.