Enum tea_codec::data::Soo

source ·
pub enum Soo<T>where
    T: ToOwned + ?Sized + 'static,{
    Static(&'static T),
    Owned(T::Owned),
}

Variants§

§

Static(&'static T)

§

Owned(T::Owned)

Trait Implementations§

source§

impl<T> AsRef<T> for Soo<T>where T: ToOwned + ?Sized + 'static, T::Owned: Borrow<T>,

source§

const fn as_ref(&self) -> &T

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRefToString for Soo<str>

source§

impl<T> Borrow<T> for Soo<T>where T: ToOwned + ?Sized + 'static, T::Owned: Borrow<T>,

source§

const fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> Clone for Soo<T>where T: ToOwned + ?Sized + 'static,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T> Debug for Soo<T>where T: ToOwned + ?Sized + Debug + 'static, T::Owned: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> Default for Soo<T>where T: ToOwned + ?Sized + 'static, T::Owned: Default,

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<T> Deref for Soo<T>where T: ToOwned + ?Sized + 'static, T::Owned: Borrow<T>,

§

type Target = T

The resulting type after dereferencing.
source§

const fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'a, T> Deserialize<'a> for Soo<T>where T: ToOwned + ?Sized + 'static, &'a T: Deserialize<'a>,

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where D: Deserializer<'a>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<T> Display for Soo<T>where T: ToOwned + ?Sized + Display + 'static, T::Owned: Display,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> From<&'static T> for Soo<T>where T: ToOwned + ?Sized + 'static,

source§

fn from(value: &'static T) -> Self

Converts to this type from the input type.
source§

impl<T> From<Box<T, Global>> for Soo<T>where T: ToOwned<Owned = Box<T>> + ?Sized + 'static,

source§

fn from(value: Box<T>) -> Self

Converts to this type from the input type.
source§

impl From<String> for Soo<str>

source§

fn from(value: String) -> Self

Converts to this type from the input type.
source§

impl<T> From<Vec<T, Global>> for Soo<[T]>where T: 'static, [T]: ToOwned<Owned = Vec<T>>,

source§

fn from(value: Vec<T>) -> Self

Converts to this type from the input type.
source§

impl<T> Hash for Soo<T>where T: ToOwned + Hash + ?Sized + 'static,

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<T> Ord for Soo<T>where T: ToOwned + ?Sized + Ord + 'static, T::Owned: Borrow<T>,

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl<T, Rhs, V> PartialEq<Rhs> for Soo<T>where T: ToOwned + ?Sized + PartialEq<V> + 'static, T::Owned: Borrow<T>, Rhs: Deref<Target = V> + ?Sized, V: ?Sized,

source§

const default fn eq(&self, other: &Rhs) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, Rhs, V> PartialOrd<Rhs> for Soo<T>where T: ToOwned + ?Sized + PartialOrd<V> + 'static, T::Owned: Borrow<T>, Rhs: Deref<Target = V> + ?Sized, V: ?Sized,

source§

const fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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 · source§

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
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<T> Serialize for Soo<T>where T: ToOwned + ?Sized + 'static + Serialize,

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<T> Eq for Soo<T>where T: ToOwned + ?Sized + Eq + 'static,

Auto Trait Implementations§

§

impl<T: ?Sized> RefUnwindSafe for Soo<T>where T: RefUnwindSafe, <T as ToOwned>::Owned: RefUnwindSafe,

§

impl<T: ?Sized> Send for Soo<T>where T: Sync, <T as ToOwned>::Owned: Send,

§

impl<T: ?Sized> Sync for Soo<T>where T: Sync, <T as ToOwned>::Owned: Sync,

§

impl<T: ?Sized> Unpin for Soo<T>where <T as ToOwned>::Owned: Unpin,

§

impl<T: ?Sized> UnwindSafe for Soo<T>where T: RefUnwindSafe, <T as ToOwned>::Owned: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<'x, T> ArcIterExt<'x> for Twhere T: 'x,

source§

fn arc_iter<F, Iter>(self: &Arc<T>, selector: F) -> ArcIter<'x, T, Iter> where &'a Iter: for<'a> IntoIterator, <&'a Iter as IntoIterator>::Item: for<'a> Deref, <<&'a Iter as IntoIterator>::Item as Deref>::Target: for<'a> Clone, F: FnOnce(&T) -> &Iter,

source§

impl<T> AsRefIntoVec for Twhere T: AsRef<[u8]>,

source§

default fn as_ref_into_vec(self) -> Vec<u8, Global>

source§

impl<T> AsRefToString for Twhere T: AsRef<str>,

source§

default fn as_ref_to_string(self) -> Soo<str>

source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<'a, T> FromBytes<'a> for Twhere T: IsFromBytes<'a>,

source§

default fn from_bytes(buf: &'a [u8]) -> Result<T, Error<Serde>>

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> PricedOrDefault for T

source§

default fn price(&self) -> Option<u64>

source§

impl<T> ToBytes for Twhere T: IsToBytes,

source§

impl<T> ToHex for Twhere T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> Uwhere U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> Uwhere U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,

source§

impl<T> NotError for Twhere TypeMark<T>: NotWrappedError,