Expand description
A type which can be serialized as a single item, or multiple items.
In some contexts, a Single may be semantically distinct from a Vec containing only item.
Variants
Single(Box<T, Global>)
Vec(Vec<T, Global>)
Trait Implementations
sourceimpl<T> Clone for SingleOrVec<T> where
    T: Clone, 
 
impl<T> Clone for SingleOrVec<T> where
    T: Clone, 
sourcefn clone(&self) -> SingleOrVec<T>
 
fn clone(&self) -> SingleOrVec<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<T> Debug for SingleOrVec<T> where
    T: Debug, 
 
impl<T> Debug for SingleOrVec<T> where
    T: Debug, 
sourceimpl<'de, T> Deserialize<'de> for SingleOrVec<T> where
    T: Deserialize<'de>, 
 
impl<'de, T> Deserialize<'de> for SingleOrVec<T> where
    T: Deserialize<'de>, 
sourcefn deserialize<__D>(
    __deserializer: __D
) -> Result<SingleOrVec<T>, <__D as Deserializer<'de>>::Error> where
    __D: Deserializer<'de>, 
 
fn deserialize<__D>(
    __deserializer: __D
) -> Result<SingleOrVec<T>, <__D as Deserializer<'de>>::Error> where
    __D: Deserializer<'de>, 
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<T> From<T> for SingleOrVec<T>
 
impl<T> From<T> for SingleOrVec<T>
sourcefn from(single: T) -> SingleOrVec<T>
 
fn from(single: T) -> SingleOrVec<T>
Converts to this type from the input type.
sourceimpl<T> From<Vec<T, Global>> for SingleOrVec<T>
 
impl<T> From<Vec<T, Global>> for SingleOrVec<T>
sourcefn from(vec: Vec<T, Global>) -> SingleOrVec<T>
 
fn from(vec: Vec<T, Global>) -> SingleOrVec<T>
Converts to this type from the input type.
sourceimpl<T> Ord for SingleOrVec<T> where
    T: Ord, 
 
impl<T> Ord for SingleOrVec<T> where
    T: Ord, 
sourceimpl<T> PartialEq<SingleOrVec<T>> for SingleOrVec<T> where
    T: PartialEq<T>, 
 
impl<T> PartialEq<SingleOrVec<T>> for SingleOrVec<T> where
    T: PartialEq<T>, 
sourcefn eq(&self, other: &SingleOrVec<T>) -> bool
 
fn eq(&self, other: &SingleOrVec<T>) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &SingleOrVec<T>) -> bool
 
fn ne(&self, other: &SingleOrVec<T>) -> bool
This method tests for !=.
sourceimpl<T> PartialOrd<SingleOrVec<T>> for SingleOrVec<T> where
    T: PartialOrd<T>, 
 
impl<T> PartialOrd<SingleOrVec<T>> for SingleOrVec<T> where
    T: PartialOrd<T>, 
sourcefn partial_cmp(&self, other: &SingleOrVec<T>) -> Option<Ordering>
 
fn partial_cmp(&self, other: &SingleOrVec<T>) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
 
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
 
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<T> Serialize for SingleOrVec<T> where
    T: Serialize, 
 
impl<T> Serialize for SingleOrVec<T> where
    T: Serialize, 
sourcefn serialize<__S>(
    &self, 
    __serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
    __S: Serializer, 
 
fn serialize<__S>(
    &self, 
    __serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
    __S: Serializer, 
Serialize this value into the given Serde serializer. Read more
impl<T> Eq for SingleOrVec<T> where
    T: Eq, 
impl<T> StructuralEq for SingleOrVec<T>
impl<T> StructuralPartialEq for SingleOrVec<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for SingleOrVec<T> where
    T: RefUnwindSafe, 
impl<T> Send for SingleOrVec<T> where
    T: Send, 
impl<T> Sync for SingleOrVec<T> where
    T: Sync, 
impl<T> Unpin for SingleOrVec<T> where
    T: Unpin, 
impl<T> UnwindSafe for SingleOrVec<T> where
    T: UnwindSafe, 
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
    T: ?Sized, 
 
impl<T> BorrowMut<T> for T where
    T: ?Sized, 
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
    T: Clone, 
 
impl<T> ToOwned for T where
    T: Clone, 
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
 
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more