pub enum WrappedCollection<T> {
NoWrapping(T),
Parentheses(T),
}
Expand description
Helper to indicate if a collection should be wrapped by a symbol in the display form
Display
is implemented for every Vec<T>
where T: Display
.
The string output is a comma separated list for the vec items
§Examples
let items = WrappedCollection::Parentheses(vec!["one", "two", "three"]);
assert_eq!("(one, two, three)", items.to_string());
let items = WrappedCollection::NoWrapping(vec!["one", "two", "three"]);
assert_eq!("one, two, three", items.to_string());
Variants§
NoWrapping(T)
Print the collection without wrapping symbols, as item, item, item
Parentheses(T)
Wraps the collection in Parentheses, as (item, item, item)
Trait Implementations§
Source§impl<T> Clone for WrappedCollection<T>where
T: Clone,
impl<T> Clone for WrappedCollection<T>where
T: Clone,
Source§fn clone(&self) -> WrappedCollection<T>
fn clone(&self) -> WrappedCollection<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T> Debug for WrappedCollection<T>where
T: Debug,
impl<T> Debug for WrappedCollection<T>where
T: Debug,
Source§impl<T> Hash for WrappedCollection<T>where
T: Hash,
impl<T> Hash for WrappedCollection<T>where
T: Hash,
Source§impl<T> Ord for WrappedCollection<T>where
T: Ord,
impl<T> Ord for WrappedCollection<T>where
T: Ord,
Source§fn cmp(&self, other: &WrappedCollection<T>) -> Ordering
fn cmp(&self, other: &WrappedCollection<T>) -> Ordering
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> PartialEq for WrappedCollection<T>where
T: PartialEq,
impl<T> PartialEq for WrappedCollection<T>where
T: PartialEq,
Source§impl<T> PartialOrd for WrappedCollection<T>where
T: PartialOrd,
impl<T> PartialOrd for WrappedCollection<T>where
T: PartialOrd,
Source§impl<T> Visit for WrappedCollection<T>where
T: Visit,
impl<T> Visit for WrappedCollection<T>where
T: Visit,
Source§impl<T> VisitMut for WrappedCollection<T>where
T: VisitMut,
impl<T> VisitMut for WrappedCollection<T>where
T: VisitMut,
fn visit<V>(&mut self, visitor: &mut V) -> ControlFlow<<V as VisitorMut>::Break>where
V: VisitorMut,
impl<T> Eq for WrappedCollection<T>where
T: Eq,
impl<T> StructuralPartialEq for WrappedCollection<T>
Auto Trait Implementations§
impl<T> Freeze for WrappedCollection<T>where
T: Freeze,
impl<T> RefUnwindSafe for WrappedCollection<T>where
T: RefUnwindSafe,
impl<T> Send for WrappedCollection<T>where
T: Send,
impl<T> Sync for WrappedCollection<T>where
T: Sync,
impl<T> Unpin for WrappedCollection<T>where
T: Unpin,
impl<T> UnwindSafe for WrappedCollection<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
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
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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