Enum vector_config_common::schema::SingleOrVec
source · pub enum SingleOrVec<T> {
Single(Box<T>),
Vec(Vec<T>),
}
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§
Implementations§
Trait Implementations§
source§impl<T: Clone> Clone for SingleOrVec<T>
impl<T: Clone> Clone for SingleOrVec<T>
source§fn clone(&self) -> SingleOrVec<T>
fn clone(&self) -> SingleOrVec<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 SingleOrVec<T>
impl<T: Debug> Debug for SingleOrVec<T>
source§impl<'de, T> Deserialize<'de> for SingleOrVec<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for SingleOrVec<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: Clone> Extend<T> for SingleOrVec<T>
impl<T: Clone> Extend<T> for SingleOrVec<T>
source§fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl<T> From<T> for SingleOrVec<T>
impl<T> From<T> for SingleOrVec<T>
source§impl<T> From<Vec<T>> for SingleOrVec<T>
impl<T> From<Vec<T>> for SingleOrVec<T>
source§impl<'a, T> IntoIterator for &'a SingleOrVec<T>
impl<'a, T> IntoIterator for &'a SingleOrVec<T>
source§impl<T: Ord> Ord for SingleOrVec<T>
impl<T: Ord> Ord for SingleOrVec<T>
source§fn cmp(&self, other: &SingleOrVec<T>) -> Ordering
fn cmp(&self, other: &SingleOrVec<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 SingleOrVec<T>
impl<T: PartialEq> PartialEq for SingleOrVec<T>
source§fn 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 ==
.source§impl<T: PartialOrd> PartialOrd for SingleOrVec<T>
impl<T: PartialOrd> PartialOrd for SingleOrVec<T>
source§fn partial_cmp(&self, other: &SingleOrVec<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &SingleOrVec<T>) -> Option<Ordering>
1.0.0 · source§fn 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 moresource§impl<T> Serialize for SingleOrVec<T>where
T: Serialize,
impl<T> Serialize for SingleOrVec<T>where
T: Serialize,
impl<T: Eq> Eq for SingleOrVec<T>
impl<T> StructuralPartialEq for SingleOrVec<T>
Auto Trait Implementations§
impl<T> Freeze for SingleOrVec<T>
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§
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.