fidl_codec

Enum 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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 TryFrom<&Value> for bool

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

Source§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _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, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

Source§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _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>,

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

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