pub enum ListItem<T> {
Trailing {
item: T,
separator: Token,
},
NonTrailing(T),
}Expand description
A possible list item of type T.
Variants§
Trailing
A trailing one.
local _ = 1, 21 is trailing in this case.
NonTrailing(T)
A non trailing one.
local _ = 1, 22 is non trailing in this case.
Trait Implementations§
Source§impl<T: Ord> Ord for ListItem<T>
impl<T: Ord> Ord for ListItem<T>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialOrd> PartialOrd for ListItem<T>
impl<T: PartialOrd> PartialOrd for ListItem<T>
Source§impl<T: Print> Print for ListItem<T>
impl<T: Print> Print for ListItem<T>
Source§fn print_final_trivia(&self) -> String
fn print_final_trivia(&self) -> String
Prints only the very final trivia. Used for the default implementation of
Print::print, which just joins Print::print_without_final_trivia
and this function.Source§fn print_without_final_trivia(&self) -> String
fn print_without_final_trivia(&self) -> String
Prints the whole token including all surrounding trivia, excluding the
very last trailing trivia.
impl<T: Eq> Eq for ListItem<T>
impl<T> StructuralPartialEq for ListItem<T>
Auto Trait Implementations§
impl<T> Freeze for ListItem<T>where
T: Freeze,
impl<T> RefUnwindSafe for ListItem<T>where
T: RefUnwindSafe,
impl<T> Send for ListItem<T>where
T: Send,
impl<T> Sync for ListItem<T>where
T: Sync,
impl<T> Unpin for ListItem<T>where
T: Unpin,
impl<T> UnwindSafe for ListItem<T>where
T: UnwindSafe,
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