Enum fidl_codec::Value

source ·
pub enum Value<OutOfLine = Forbid> {
Show 22 variants Null, Bool(bool), U8(u8), U16(u16), U32(u32), U64(u64), I8(i8), I16(i16), I32(i32), I64(i64), F32(f32), F64(f64), String(String), Object(Vec<(String, Self)>), Bits(String, Box<Self>), Enum(String, Box<Self>), Union(String, String, Box<Self>), List(Vec<Self>), ServerEnd(Channel, String), ClientEnd(Channel, String), Handle(Handle, ObjectType), OutOfLine(OutOfLine),
}
Expand description

Our internal neutral form for FIDL values.

Variants§

§

Null

§

Bool(bool)

§

U8(u8)

§

U16(u16)

§

U32(u32)

§

U64(u64)

§

I8(i8)

§

I16(i16)

§

I32(i32)

§

I64(i64)

§

F32(f32)

§

F64(f64)

§

String(String)

§

Object(Vec<(String, Self)>)

§

Bits(String, Box<Self>)

§

Enum(String, Box<Self>)

§

Union(String, String, Box<Self>)

§

List(Vec<Self>)

§

ServerEnd(Channel, String)

§

ClientEnd(Channel, String)

§

Handle(Handle, ObjectType)

§

OutOfLine(OutOfLine)

Implementations§

source§

impl Value

source

pub fn upcast<T>(self) -> Value<T>

Cast a Value<Forbid> to a Value<T> for any T

Trait Implementations§

source§

impl<OutOfLine: Debug> Debug for Value<OutOfLine>

source§

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

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

impl<T: Display> Display for Value<T>

source§

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

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

impl From<&str> for Value

source§

fn from(v: &str) -> Value

Converts to this type from the input type.
source§

impl<T> From<Option<T>> for Value
where Value: From<T>,

source§

fn from(v: Option<T>) -> Value

Converts to this type from the input type.
source§

impl From<String> for Value

source§

fn from(v: String) -> Value

Converts to this type from the input type.
source§

impl<T> From<Vec<T>> for Value
where Value: From<T>,

source§

fn from(v: Vec<T>) -> Value

Converts to this type from the input type.
source§

impl From<bool> for Value

source§

fn from(v: bool) -> Value

Converts to this type from the input type.
source§

impl From<f32> for Value

source§

fn from(v: f32) -> Value

Converts to this type from the input type.
source§

impl From<f64> for Value

source§

fn from(v: f64) -> Value

Converts to this type from the input type.
source§

impl From<i16> for Value

source§

fn from(v: i16) -> Value

Converts to this type from the input type.
source§

impl From<i32> for Value

source§

fn from(v: i32) -> Value

Converts to this type from the input type.
source§

impl From<i64> for Value

source§

fn from(v: i64) -> Value

Converts to this type from the input type.
source§

impl From<i8> for Value

source§

fn from(v: i8) -> Value

Converts to this type from the input type.
source§

impl From<u16> for Value

source§

fn from(v: u16) -> Value

Converts to this type from the input type.
source§

impl From<u32> for Value

source§

fn from(v: u32) -> Value

Converts to this type from the input type.
source§

impl From<u64> for Value

source§

fn from(v: u64) -> Value

Converts to this type from the input type.
source§

impl From<u8> for Value

source§

fn from(v: u8) -> Value

Converts to this type from the input type.
source§

impl<A> FromIterator<A> for Value
where Value: From<A>,

source§

fn from_iter<T: IntoIterator<Item = A>>(iter: T) -> Value

Creates a value from an iterator. Read more
source§

impl PartialEq for Value

source§

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

§

type Error = Error

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

fn try_from(value: &Value) -> Result<bool, Error>

Performs the conversion.
source§

impl TryFrom<&Value> for f32

§

type Error = Error

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

fn try_from(value: &Value) -> Result<f32, Error>

Performs the conversion.
source§

impl TryFrom<&Value> for f64

§

type Error = Error

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

fn try_from(value: &Value) -> Result<f64, Error>

Performs the conversion.
source§

impl TryFrom<&Value> for i16

§

type Error = Error

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

fn try_from(value: &Value) -> Result<i16, Error>

Performs the conversion.
source§

impl TryFrom<&Value> for i32

§

type Error = Error

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

fn try_from(value: &Value) -> Result<i32, Error>

Performs the conversion.
source§

impl TryFrom<&Value> for i64

§

type Error = Error

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

fn try_from(value: &Value) -> Result<i64, Error>

Performs the conversion.
source§

impl TryFrom<&Value> for i8

§

type Error = Error

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

fn try_from(value: &Value) -> Result<i8, Error>

Performs the conversion.
source§

impl TryFrom<&Value> for u16

§

type Error = Error

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

fn try_from(value: &Value) -> Result<u16, Error>

Performs the conversion.
source§

impl TryFrom<&Value> for u32

§

type Error = Error

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

fn try_from(value: &Value) -> Result<u32, Error>

Performs the conversion.
source§

impl TryFrom<&Value> for u64

§

type Error = Error

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

fn try_from(value: &Value) -> Result<u64, Error>

Performs the conversion.
source§

impl TryFrom<&Value> for u8

§

type Error = Error

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

fn try_from(value: &Value) -> Result<u8, Error>

Performs the conversion.
source§

impl TryFrom<&mut Value> for bool

§

type Error = Error

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

fn try_from(value: &mut Value) -> Result<bool, Error>

Performs the conversion.
source§

impl TryFrom<&mut Value> for f32

§

type Error = Error

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

fn try_from(value: &mut Value) -> Result<f32, Error>

Performs the conversion.
source§

impl TryFrom<&mut Value> for f64

§

type Error = Error

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

fn try_from(value: &mut Value) -> Result<f64, Error>

Performs the conversion.
source§

impl TryFrom<&mut Value> for i16

§

type Error = Error

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

fn try_from(value: &mut Value) -> Result<i16, Error>

Performs the conversion.
source§

impl TryFrom<&mut Value> for i32

§

type Error = Error

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

fn try_from(value: &mut Value) -> Result<i32, Error>

Performs the conversion.
source§

impl TryFrom<&mut Value> for i64

§

type Error = Error

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

fn try_from(value: &mut Value) -> Result<i64, Error>

Performs the conversion.
source§

impl TryFrom<&mut Value> for i8

§

type Error = Error

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

fn try_from(value: &mut Value) -> Result<i8, Error>

Performs the conversion.
source§

impl TryFrom<&mut Value> for u16

§

type Error = Error

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

fn try_from(value: &mut Value) -> Result<u16, Error>

Performs the conversion.
source§

impl TryFrom<&mut Value> for u32

§

type Error = Error

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

fn try_from(value: &mut Value) -> Result<u32, Error>

Performs the conversion.
source§

impl TryFrom<&mut Value> for u64

§

type Error = Error

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

fn try_from(value: &mut Value) -> Result<u64, Error>

Performs the conversion.
source§

impl TryFrom<&mut Value> for u8

§

type Error = Error

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

fn try_from(value: &mut Value) -> Result<u8, Error>

Performs the conversion.
source§

impl TryFrom<Value> for bool

§

type Error = Error

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

fn try_from(value: Value) -> Result<bool, Error>

Performs the conversion.
source§

impl TryFrom<Value> for f32

§

type Error = Error

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

fn try_from(value: Value) -> Result<f32, Error>

Performs the conversion.
source§

impl TryFrom<Value> for f64

§

type Error = Error

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

fn try_from(value: Value) -> Result<f64, Error>

Performs the conversion.
source§

impl TryFrom<Value> for i16

§

type Error = Error

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

fn try_from(value: Value) -> Result<i16, Error>

Performs the conversion.
source§

impl TryFrom<Value> for i32

§

type Error = Error

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

fn try_from(value: Value) -> Result<i32, Error>

Performs the conversion.
source§

impl TryFrom<Value> for i64

§

type Error = Error

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

fn try_from(value: Value) -> Result<i64, Error>

Performs the conversion.
source§

impl TryFrom<Value> for i8

§

type Error = Error

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

fn try_from(value: Value) -> Result<i8, Error>

Performs the conversion.
source§

impl TryFrom<Value> for u16

§

type Error = Error

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

fn try_from(value: Value) -> Result<u16, Error>

Performs the conversion.
source§

impl TryFrom<Value> for u32

§

type Error = Error

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

fn try_from(value: Value) -> Result<u32, Error>

Performs the conversion.
source§

impl TryFrom<Value> for u64

§

type Error = Error

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

fn try_from(value: Value) -> Result<u64, Error>

Performs the conversion.
source§

impl TryFrom<Value> for u8

§

type Error = Error

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

fn try_from(value: Value) -> Result<u8, Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<OutOfLine> Freeze for Value<OutOfLine>
where OutOfLine: Freeze,

§

impl<OutOfLine> RefUnwindSafe for Value<OutOfLine>
where OutOfLine: RefUnwindSafe,

§

impl<OutOfLine> Send for Value<OutOfLine>
where OutOfLine: Send,

§

impl<OutOfLine> Sync for Value<OutOfLine>
where OutOfLine: Sync,

§

impl<OutOfLine> Unpin for Value<OutOfLine>
where OutOfLine: Unpin,

§

impl<OutOfLine> UnwindSafe for Value<OutOfLine>
where OutOfLine: UnwindSafe,

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> Encode<Ambiguous1> for T

source§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
source§

impl<T> Encode<Ambiguous2> for T

source§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

impl<T> ToString for T
where 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 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.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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