Trait fidl::encoding::ValueTypeMarker

source ·
pub trait ValueTypeMarker: TypeMarker {
    type Borrowed<'a>;

    // Required method
    fn borrow(value: &Self::Owned) -> Self::Borrowed<'_>;
}
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>

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(value: &Self::Owned) -> Self::Borrowed<'_>

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

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ValueTypeMarker for bool

§

type Borrowed<'a> = bool

source§

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

source§

impl ValueTypeMarker for f32

§

type Borrowed<'a> = f32

source§

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

source§

impl ValueTypeMarker for f64

§

type Borrowed<'a> = f64

source§

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

source§

impl ValueTypeMarker for i8

§

type Borrowed<'a> = i8

source§

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

source§

impl ValueTypeMarker for i16

§

type Borrowed<'a> = i16

source§

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

source§

impl ValueTypeMarker for i32

§

type Borrowed<'a> = i32

source§

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

source§

impl ValueTypeMarker for i64

§

type Borrowed<'a> = i64

source§

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

source§

impl ValueTypeMarker for u8

§

type Borrowed<'a> = u8

source§

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

source§

impl ValueTypeMarker for u16

§

type Borrowed<'a> = u16

source§

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

source§

impl ValueTypeMarker for u32

§

type Borrowed<'a> = u32

source§

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

source§

impl ValueTypeMarker for u64

§

type Borrowed<'a> = u64

source§

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

Implementors§

source§

impl ValueTypeMarker for FrameworkErr

source§

impl ValueTypeMarker for ObjectType

source§

impl ValueTypeMarker for Rights

§

type Borrowed<'a> = Rights

source§

impl ValueTypeMarker for WireMetadata

§

type Borrowed<'a> = &'a WireMetadata

source§

impl ValueTypeMarker for Ambiguous1

source§

impl ValueTypeMarker for Ambiguous2

source§

impl ValueTypeMarker for EmptyPayload

§

type Borrowed<'a> = ()

source§

impl ValueTypeMarker for EmptyStruct

§

type Borrowed<'a> = ()

source§

impl ValueTypeMarker for EpitaphBody

§

type Borrowed<'a> = &'a EpitaphBody

source§

impl ValueTypeMarker for TransactionHeader

source§

impl<T: Timeline + Copy + 'static, U: Copy + 'static> ValueTypeMarker for Instant<T, U>

§

type Borrowed<'a> = Instant<T, U>

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