Struct serde_single_or_vec2::SingleOrVec
source · [−]pub struct SingleOrVec<'a, T, F: Format = PreferSingle, S: Storage<'a, T> = Vec<T>> { /* private fields */ }
Expand description
Provides a type which can be used to parse server respsonses which either return an array or only a single value.
Implementations
sourceimpl<'a, T, F, S> SingleOrVec<'a, T, F, S>where
F: Format,
S: Storage<'a, T>,
impl<'a, T, F, S> SingleOrVec<'a, T, F, S>where
F: Format,
S: Storage<'a, T>,
sourcepub fn new_single(ty: T) -> Self
pub fn new_single(ty: T) -> Self
Creates the type using a single value
Trait Implementations
sourceimpl<'a, T, F, S, B> Clone for SingleOrVec<'a, T, F, S>where
F: Format,
S: Storage<'a, T, Backing = B>,
B: Clone,
impl<'a, T, F, S, B> Clone for SingleOrVec<'a, T, F, S>where
F: Format,
S: Storage<'a, T, Backing = B>,
B: Clone,
sourceimpl<'a, T, F, S, B> Debug for SingleOrVec<'a, T, F, S>where
F: Format,
S: Storage<'a, T, Backing = B>,
B: Debug,
impl<'a, T, F, S, B> Debug for SingleOrVec<'a, T, F, S>where
F: Format,
S: Storage<'a, T, Backing = B>,
B: Debug,
sourceimpl<'a, T, F, S, B> Default for SingleOrVec<'a, T, F, S>where
F: Format,
S: Storage<'a, T, Backing = B>,
B: Default,
impl<'a, T, F, S, B> Default for SingleOrVec<'a, T, F, S>where
F: Format,
S: Storage<'a, T, Backing = B>,
B: Default,
sourceimpl<'a, T, F, S> Deref for SingleOrVec<'a, T, F, S>where
F: Format,
S: Storage<'a, T>,
impl<'a, T, F, S> Deref for SingleOrVec<'a, T, F, S>where
F: Format,
S: Storage<'a, T>,
sourceimpl<'a, T, F, S> DerefMut for SingleOrVec<'a, T, F, S>where
F: Format,
S: Storage<'a, T>,
impl<'a, T, F, S> DerefMut for SingleOrVec<'a, T, F, S>where
F: Format,
S: Storage<'a, T>,
sourceimpl<'de, 'a, T, F, S, B> Deserialize<'de> for SingleOrVec<'a, T, F, S>where
T: Deserialize<'de>,
F: Format,
S: Storage<'a, T, Backing = B>,
B: Deserialize<'de>,
impl<'de, 'a, T, F, S, B> Deserialize<'de> for SingleOrVec<'a, T, F, S>where
T: Deserialize<'de>,
F: Format,
S: Storage<'a, T, Backing = B>,
B: Deserialize<'de>,
sourcefn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<'a, T, F, S, B> From<T> for SingleOrVec<'a, T, F, S>where
F: Format,
S: Storage<'a, T, Backing = B>,
B: From<T>,
impl<'a, T, F, S, B> From<T> for SingleOrVec<'a, T, F, S>where
F: Format,
S: Storage<'a, T, Backing = B>,
B: From<T>,
sourceimpl<'a, T, F, S, B> Hash for SingleOrVec<'a, T, F, S>where
F: Format,
S: Storage<'a, T, Backing = B>,
B: Hash,
impl<'a, T, F, S, B> Hash for SingleOrVec<'a, T, F, S>where
F: Format,
S: Storage<'a, T, Backing = B>,
B: Hash,
sourceimpl<'a, T, F, S, B> Ord for SingleOrVec<'a, T, F, S>where
F: Format,
S: Storage<'a, T, Backing = B>,
B: Ord,
impl<'a, T, F, S, B> Ord for SingleOrVec<'a, T, F, S>where
F: Format,
S: Storage<'a, T, Backing = B>,
B: Ord,
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<'a, T, F, F2, S, B> PartialEq<SingleOrVec<'a, T, F2, S>> for SingleOrVec<'a, T, F, S>where
F: Format,
F2: Format,
S: Storage<'a, T, Backing = B>,
B: PartialEq,
impl<'a, T, F, F2, S, B> PartialEq<SingleOrVec<'a, T, F2, S>> for SingleOrVec<'a, T, F, S>where
F: Format,
F2: Format,
S: Storage<'a, T, Backing = B>,
B: PartialEq,
sourcefn eq(&self, other: &SingleOrVec<'a, T, F2, S>) -> bool
fn eq(&self, other: &SingleOrVec<'a, T, F2, S>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl<'a, T, F, F2, S, B> PartialOrd<SingleOrVec<'a, T, F2, S>> for SingleOrVec<'a, T, F, S>where
F: Format,
F2: Format,
S: Storage<'a, T, Backing = B>,
B: PartialOrd,
impl<'a, T, F, F2, S, B> PartialOrd<SingleOrVec<'a, T, F2, S>> for SingleOrVec<'a, T, F, S>where
F: Format,
F2: Format,
S: Storage<'a, T, Backing = B>,
B: PartialOrd,
sourcefn partial_cmp(&self, other: &SingleOrVec<'a, T, F2, S>) -> Option<Ordering>
fn partial_cmp(&self, other: &SingleOrVec<'a, T, F2, S>) -> 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<'a, T, F, St, B> Serialize for SingleOrVec<'a, T, F, St>where
T: Serialize,
F: Format,
St: Storage<'a, T, Backing = B>,
B: Serialize,
impl<'a, T, F, St, B> Serialize for SingleOrVec<'a, T, F, St>where
T: Serialize,
F: Format,
St: Storage<'a, T, Backing = B>,
B: Serialize,
impl<'a, T, F, S, B> Eq for SingleOrVec<'a, T, F, S>where
F: Format,
S: Storage<'a, T, Backing = B>,
B: Eq,
Auto Trait Implementations
impl<'a, T, F, S> RefUnwindSafe for SingleOrVec<'a, T, F, S>where
F: RefUnwindSafe,
<S as Storage<'a, T>>::Backing: RefUnwindSafe,
impl<'a, T, F, S> Send for SingleOrVec<'a, T, F, S>where
F: Send,
<S as Storage<'a, T>>::Backing: Send,
impl<'a, T, F, S> Sync for SingleOrVec<'a, T, F, S>where
F: Sync,
<S as Storage<'a, T>>::Backing: Sync,
impl<'a, T, F, S> Unpin for SingleOrVec<'a, T, F, S>where
F: Unpin,
<S as Storage<'a, T>>::Backing: Unpin,
impl<'a, T, F, S> UnwindSafe for SingleOrVec<'a, T, F, S>where
F: UnwindSafe,
<S as Storage<'a, T>>::Backing: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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