Skip to main content

GenericFormattedValue

Enum GenericFormattedValue 

Source
pub enum GenericFormattedValue {
    Undefined(Undefined),
    Default(Option<Default>),
    Bytes(Option<Bytes>),
    Time(Option<ClockTime>),
    Buffers(Option<Buffers>),
    Percent(Option<Percent>),
    Other(Format, Option<Other>),
}

Variants§

§

Undefined(Undefined)

§

Default(Option<Default>)

§

Bytes(Option<Bytes>)

§

Time(Option<ClockTime>)

§

Buffers(Option<Buffers>)

§

Percent(Option<Percent>)

§

Other(Format, Option<Other>)

Implementations§

Source§

impl GenericFormattedValue

Source

pub fn new(format: Format, value: i64) -> Self

Source

pub fn format(&self) -> Format

Source

pub fn value(&self) -> i64

Trait Implementations§

Source§

impl Clone for GenericFormattedValue

Source§

fn clone(&self) -> GenericFormattedValue

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl CompatibleFormattedValue<GenericFormattedValue> for GenericFormattedValue

Source§

type Original = GenericFormattedValue

Source§

fn try_into_checked( self, other: GenericFormattedValue, ) -> Result<Self, FormattedValueError>

Returns Ok(self) with its type restored if it is compatible with the format of other. Read more
Source§

fn try_into_checked_explicit( self, format: Format, ) -> Result<Self::Original, FormattedValueError>

Returns Ok(self) with its type restored if it is compatible with the format of V. Read more
Source§

impl<V: SpecificFormattedValue> CompatibleFormattedValue<V> for GenericFormattedValue

Source§

type Original = GenericFormattedValue

Source§

fn try_into_checked(self, _other: V) -> Result<Self, FormattedValueError>

Returns Ok(self) with its type restored if it is compatible with the format of other. Read more
Source§

fn try_into_checked_explicit( self, _format: Format, ) -> Result<Self::Original, FormattedValueError>

Returns Ok(self) with its type restored if it is compatible with the format of V. Read more
Source§

impl Copy for GenericFormattedValue

Source§

impl Debug for GenericFormattedValue

Source§

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

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

impl<'de> Deserialize<'de> for GenericFormattedValue

Source§

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 Display for GenericFormattedValue

Source§

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

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

impl Displayable for GenericFormattedValue

Source§

impl Eq for GenericFormattedValue

Source§

impl FormattedValue for GenericFormattedValue

Source§

type FullRange = GenericFormattedValue

Type which allows building a FormattedValue of this format from any raw value.
Source§

fn default_format() -> Format

Source§

fn format(&self) -> Format

Source§

fn is_some(&self) -> bool

Returns true if this FormattedValue represents a defined value.
Source§

unsafe fn into_raw_value(self) -> i64

Source§

fn is_none(&self) -> bool

Returns true if this FormattedValue represents an undefined value.
Source§

impl FormattedValueFullRange for GenericFormattedValue

Source§

unsafe fn from_raw(format: Format, value: i64) -> Self

Source§

impl FormattedValueIntrinsic for GenericFormattedValue

Source§

impl FormattedValueNoneBuilder for GenericFormattedValue

Source§

fn none() -> Self

Returns the None value for Self as a FullRange if such a value can be represented. Read more
Source§

fn none_for_format(format: Format) -> Self

Returns the None value for Self if such a value can be represented. Read more
Source§

impl From<Buffers> for GenericFormattedValue

Source§

fn from(v: Buffers) -> Self

Converts to this type from the input type.
Source§

impl From<Bytes> for GenericFormattedValue

Source§

fn from(v: Bytes) -> Self

Converts to this type from the input type.
Source§

impl From<ClockTime> for GenericFormattedValue

Source§

fn from(v: ClockTime) -> Self

Converts to this type from the input type.
Source§

impl From<Default> for GenericFormattedValue

Source§

fn from(v: Default) -> Self

Converts to this type from the input type.
Source§

impl From<Option<Buffers>> for GenericFormattedValue

Source§

fn from(v: Option<Buffers>) -> Self

Converts to this type from the input type.
Source§

impl From<Option<Bytes>> for GenericFormattedValue

Source§

fn from(v: Option<Bytes>) -> Self

Converts to this type from the input type.
Source§

impl From<Option<ClockTime>> for GenericFormattedValue

Source§

fn from(v: Option<ClockTime>) -> Self

Converts to this type from the input type.
Source§

impl From<Option<Default>> for GenericFormattedValue

Source§

fn from(v: Option<Default>) -> Self

Converts to this type from the input type.
Source§

impl From<Option<Percent>> for GenericFormattedValue

Source§

fn from(v: Option<Percent>) -> Self

Converts to this type from the input type.
Source§

impl From<Percent> for GenericFormattedValue

Source§

fn from(v: Percent) -> Self

Converts to this type from the input type.
Source§

impl From<Undefined> for GenericFormattedValue

Source§

fn from(v: Undefined) -> Self

Converts to this type from the input type.
Source§

impl Hash for GenericFormattedValue

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 PartialEq for GenericFormattedValue

Source§

fn eq(&self, other: &GenericFormattedValue) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for GenericFormattedValue

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 SignedIntrinsic for GenericFormattedValue

Source§

impl StructuralPartialEq for GenericFormattedValue

Source§

impl TryFrom<GenericFormattedValue> for Option<ClockTime>

Source§

type Error = FormattedValueError

The type returned in the event of a conversion error.
Source§

fn try_from(v: GenericFormattedValue) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<GenericFormattedValue> for Option<Buffers>

Source§

type Error = FormattedValueError

The type returned in the event of a conversion error.
Source§

fn try_from(v: GenericFormattedValue) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<GenericFormattedValue> for Option<Bytes>

Source§

type Error = FormattedValueError

The type returned in the event of a conversion error.
Source§

fn try_from(v: GenericFormattedValue) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<GenericFormattedValue> for Option<Default>

Source§

type Error = FormattedValueError

The type returned in the event of a conversion error.
Source§

fn try_from(v: GenericFormattedValue) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<GenericFormattedValue> for Option<Percent>

Source§

type Error = FormattedValueError

The type returned in the event of a conversion error.
Source§

fn try_from(v: GenericFormattedValue) -> Result<Option<Percent>, Self::Error>

Performs the conversion.
Source§

impl TryFrom<GenericFormattedValue> for Undefined

Source§

type Error = FormattedValueError

The type returned in the event of a conversion error.
Source§

fn try_from(v: GenericFormattedValue) -> Result<Undefined, Self::Error>

Performs the conversion.
Source§

impl UnsignedIntoSigned for GenericFormattedValue

Source§

type Signed = GenericSignedFormattedValue

Source§

fn into_positive(self) -> Self::Signed

Converts self into a Signed::Positive.
Source§

fn into_negative(self) -> Self::Signed

Converts self into a Signed::Negative.
Source§

fn into_signed(self, sign: i32) -> Self::Signed

Converts self into a Signed matching the given sign.

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> CompatibleFormattedValue<GenericFormattedValue> for T

Source§

type Original = T

Source§

fn try_into_checked( self, other: GenericFormattedValue, ) -> Result<T, FormattedValueError>

Returns Ok(self) with its type restored if it is compatible with the format of other. Read more
Source§

fn try_into_checked_explicit( self, format: Format, ) -> Result<<T as CompatibleFormattedValue<GenericFormattedValue>>::Original, FormattedValueError>

Returns Ok(self) with its type restored if it is compatible with the format of V. Read more
Source§

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

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> NoneSignedBuilder for T

Source§

type Signed = <T as UnsignedIntoSigned>::Signed

Source§

fn none_signed() -> <T as NoneSignedBuilder>::Signed

Returns the None value for Self as a Signed<FullRange> if such a value can be represented. Read more
Source§

fn none_signed_for_format(format: Format) -> <T as NoneSignedBuilder>::Signed

Returns the None value for Self as a Signed<FullRange>, if such a value can be represented. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

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

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.