pub trait ValueTypeMarker: TypeMarker {
    type Borrowed<'a>: Encode<Self>;

    // Required method
    fn borrow<'a>(value: &'a Self::Owned) -> Self::Borrowed<'a>;
}
Expand description

A FIDL value type marker.

Value types are guaranteed to never contain handles. As a result, they can be encoded by immutable reference (or by value for Copy types).

Required Associated Types§

source

type Borrowed<'a>: Encode<Self>

The Rust type to use for encoding. This is a particular Encode<Self> type cheaply obtainable from &Self::Owned. There are three cases:

  • Special cases such as &[T] for vectors.
  • For primitives, bits, and enums, it is Owned.
  • Otherwise, it is &Owned.

Required Methods§

source

fn borrow<'a>(value: &'a Self::Owned) -> Self::Borrowed<'a>

Cheaply converts from &Self::Owned to Self::Borrowed.

Implementations on Foreign Types§

source§

impl ValueTypeMarker for f32

§

type Borrowed<'a> = <f32 as TypeMarker>::Owned

source§

fn borrow<'a>(value: &'a <Self as TypeMarker>::Owned) -> Self::Borrowed<'a>

source§

impl ValueTypeMarker for i8

§

type Borrowed<'a> = <i8 as TypeMarker>::Owned

source§

fn borrow<'a>(value: &'a <Self as TypeMarker>::Owned) -> Self::Borrowed<'a>

source§

impl ValueTypeMarker for u16

§

type Borrowed<'a> = <u16 as TypeMarker>::Owned

source§

fn borrow<'a>(value: &'a <Self as TypeMarker>::Owned) -> Self::Borrowed<'a>

source§

impl ValueTypeMarker for i32

§

type Borrowed<'a> = <i32 as TypeMarker>::Owned

source§

fn borrow<'a>(value: &'a <Self as TypeMarker>::Owned) -> Self::Borrowed<'a>

source§

impl ValueTypeMarker for i64

§

type Borrowed<'a> = <i64 as TypeMarker>::Owned

source§

fn borrow<'a>(value: &'a <Self as TypeMarker>::Owned) -> Self::Borrowed<'a>

source§

impl ValueTypeMarker for u8

§

type Borrowed<'a> = <u8 as TypeMarker>::Owned

source§

fn borrow<'a>(value: &'a <Self as TypeMarker>::Owned) -> Self::Borrowed<'a>

source§

impl ValueTypeMarker for f64

§

type Borrowed<'a> = <f64 as TypeMarker>::Owned

source§

fn borrow<'a>(value: &'a <Self as TypeMarker>::Owned) -> Self::Borrowed<'a>

source§

impl ValueTypeMarker for i16

§

type Borrowed<'a> = <i16 as TypeMarker>::Owned

source§

fn borrow<'a>(value: &'a <Self as TypeMarker>::Owned) -> Self::Borrowed<'a>

source§

impl ValueTypeMarker for u32

§

type Borrowed<'a> = <u32 as TypeMarker>::Owned

source§

fn borrow<'a>(value: &'a <Self as TypeMarker>::Owned) -> Self::Borrowed<'a>

source§

impl ValueTypeMarker for bool

§

type Borrowed<'a> = <bool as TypeMarker>::Owned

source§

fn borrow<'a>(value: &'a <Self as TypeMarker>::Owned) -> Self::Borrowed<'a>

source§

impl ValueTypeMarker for u64

§

type Borrowed<'a> = <u64 as TypeMarker>::Owned

source§

fn borrow<'a>(value: &'a <Self as TypeMarker>::Owned) -> Self::Borrowed<'a>

Implementors§

source§

impl ValueTypeMarker for FrameworkErr

source§

impl ValueTypeMarker for Status

source§

impl ValueTypeMarker for Ambiguous1

source§

impl ValueTypeMarker for Ambiguous2

source§

impl ValueTypeMarker for EmptyStruct

§

type Borrowed<'a> = ()

source§

impl ValueTypeMarker for EpitaphBody

§

type Borrowed<'a> = &'a <EpitaphBody as TypeMarker>::Owned

source§

impl ValueTypeMarker for LargeMessageInfo

source§

impl ValueTypeMarker for TransactionHeader

source§

impl ValueTypeMarker for WireMetadata

source§

impl<T: ValueTypeMarker> ValueTypeMarker for Boxed<T>

§

type Borrowed<'a> = Option<<T as ValueTypeMarker>::Borrowed<'a>>

source§

impl<T: ValueTypeMarker> ValueTypeMarker for Optional<T>

§

type Borrowed<'a> = Option<<T as ValueTypeMarker>::Borrowed<'a>>

source§

impl<T: ValueTypeMarker> ValueTypeMarker for OptionalUnion<T>

§

type Borrowed<'a> = Option<<T as ValueTypeMarker>::Borrowed<'a>>

source§

impl<T: ValueTypeMarker, const N: usize> ValueTypeMarker for Array<T, N>

§

type Borrowed<'a> = &'a [<T as TypeMarker>::Owned; N]

source§

impl<T: ValueTypeMarker, const N: usize> ValueTypeMarker for Vector<T, N>

§

type Borrowed<'a> = &'a [<T as TypeMarker>::Owned]

source§

impl<const N: usize> ValueTypeMarker for BoundedString<N>

§

type Borrowed<'a> = &'a str