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> Clone for WrappedCollection<T>
impl<T: Clone> Clone for WrappedCollection<T>
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> Debug for WrappedCollection<T>
impl<T: Debug> Debug for WrappedCollection<T>
Source§impl<'de, T> Deserialize<'de> for WrappedCollection<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for WrappedCollection<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: Hash> Hash for WrappedCollection<T>
impl<T: Hash> Hash for WrappedCollection<T>
Source§impl<T: Ord> Ord for WrappedCollection<T>
impl<T: Ord> Ord for WrappedCollection<T>
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> PartialEq for WrappedCollection<T>
impl<T: PartialEq> PartialEq for WrappedCollection<T>
Source§impl<T: PartialOrd> PartialOrd for WrappedCollection<T>
impl<T: PartialOrd> PartialOrd for WrappedCollection<T>
Source§impl<T> Serialize for WrappedCollection<T>where
T: Serialize,
impl<T> Serialize for WrappedCollection<T>where
T: Serialize,
Source§impl<T: Visit> Visit for WrappedCollection<T>
impl<T: Visit> Visit for WrappedCollection<T>
Source§impl<T: VisitMut> VisitMut for WrappedCollection<T>
impl<T: VisitMut> VisitMut for WrappedCollection<T>
fn visit<V: VisitorMut>(&mut self, visitor: &mut V) -> ControlFlow<V::Break>
impl<T: Eq> Eq for WrappedCollection<T>
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