Enum lair_keystore::dependencies::one_err::Value

source ·
pub enum Value {
    Null,
    Bool(bool),
    I64(i64),
    U64(u64),
    F64(f64),
    String(Box<str>),
}
Expand description

Value type for additional data fields on OneErr instances.

Variants§

§

Null

Empty / No Data

§

Bool(bool)

Boolean Type

§

I64(i64)

Signed Integer Type

§

U64(u64)

Unsigned Integer Type

§

F64(f64)

Floating Point Type

§

String(Box<str>)

String Type

Implementations§

source§

impl Value

source

pub fn as_bool(&self) -> Option<bool>

If this value is a bool type, return that bool.

source

pub fn as_i64(&self) -> Option<i64>

If this value is an i64 type, return that i64.

source

pub fn as_u64(&self) -> Option<u64>

If this value is a u64 type, return that u64.

source

pub fn as_f64(&self) -> Option<f64>

If this value is an f64 type, return that f64.

source

pub fn as_str(&self) -> Option<&str>

If this value is a str type, return that str.

Trait Implementations§

source§

impl Clone for Value

source§

fn clone(&self) -> Value

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 Debug for Value

source§

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

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

impl<'de> Deserialize<'de> for Value

source§

fn deserialize<D>( deserializer: D, ) -> Result<Value, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

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

impl From<&String> for Value

source§

fn from(s: &String) -> Value

Converts to this type from the input type.
source§

impl<'lt> From<&'lt Value> for Option<&'lt str>

source§

fn from(v: &'lt Value) -> Option<&'lt str>

Converts to this type from the input type.
source§

impl<'lt> From<&'lt Value> for Option<bool>

source§

fn from(v: &'lt Value) -> Option<bool>

Converts to this type from the input type.
source§

impl<'lt> From<&'lt Value> for Option<f64>

source§

fn from(v: &'lt Value) -> Option<f64>

Converts to this type from the input type.
source§

impl<'lt> From<&'lt Value> for Option<i64>

source§

fn from(v: &'lt Value) -> Option<i64>

Converts to this type from the input type.
source§

impl<'lt> From<&'lt Value> for Option<u64>

source§

fn from(v: &'lt Value) -> Option<u64>

Converts to this type from the input type.
source§

impl From<&str> for Value

source§

fn from(s: &str) -> Value

Converts to this type from the input type.
source§

impl From<Box<str>> for Value

source§

fn from(s: Box<str>) -> Value

Converts to this type from the input type.
source§

impl From<String> for Value

source§

fn from(s: String) -> Value

Converts to this type from the input type.
source§

impl From<bool> for Value

source§

fn from(b: bool) -> Value

Converts to this type from the input type.
source§

impl From<f64> for Value

source§

fn from(f: f64) -> Value

Converts to this type from the input type.
source§

impl From<i64> for Value

source§

fn from(i: i64) -> Value

Converts to this type from the input type.
source§

impl From<u64> for Value

source§

fn from(u: u64) -> Value

Converts to this type from the input type.
source§

impl PartialEq for Value

source§

fn eq(&self, other: &Value) -> 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 Serialize for Value

source§

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

impl StructuralPartialEq for Value

Auto Trait Implementations§

§

impl Freeze for Value

§

impl RefUnwindSafe for Value

§

impl Send for Value

§

impl Sync for Value

§

impl Unpin for Value

§

impl UnwindSafe for Value

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

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where 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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

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