Trait ValueTypeMarker

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§

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§

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

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl ValueTypeMarker for bool

§

type Borrowed<'a> = bool

§

fn borrow( value: &<bool as TypeMarker>::Owned, ) -> <bool as ValueTypeMarker>::Borrowed<'_>

§

impl ValueTypeMarker for f32

§

type Borrowed<'a> = f32

§

fn borrow( value: &<f32 as TypeMarker>::Owned, ) -> <f32 as ValueTypeMarker>::Borrowed<'_>

§

impl ValueTypeMarker for f64

§

type Borrowed<'a> = f64

§

fn borrow( value: &<f64 as TypeMarker>::Owned, ) -> <f64 as ValueTypeMarker>::Borrowed<'_>

§

impl ValueTypeMarker for i8

§

type Borrowed<'a> = i8

§

fn borrow( value: &<i8 as TypeMarker>::Owned, ) -> <i8 as ValueTypeMarker>::Borrowed<'_>

§

impl ValueTypeMarker for i16

§

type Borrowed<'a> = i16

§

fn borrow( value: &<i16 as TypeMarker>::Owned, ) -> <i16 as ValueTypeMarker>::Borrowed<'_>

§

impl ValueTypeMarker for i32

§

type Borrowed<'a> = i32

§

fn borrow( value: &<i32 as TypeMarker>::Owned, ) -> <i32 as ValueTypeMarker>::Borrowed<'_>

§

impl ValueTypeMarker for i64

§

type Borrowed<'a> = i64

§

fn borrow( value: &<i64 as TypeMarker>::Owned, ) -> <i64 as ValueTypeMarker>::Borrowed<'_>

§

impl ValueTypeMarker for u8

§

type Borrowed<'a> = u8

§

fn borrow( value: &<u8 as TypeMarker>::Owned, ) -> <u8 as ValueTypeMarker>::Borrowed<'_>

§

impl ValueTypeMarker for u16

§

type Borrowed<'a> = u16

§

fn borrow( value: &<u16 as TypeMarker>::Owned, ) -> <u16 as ValueTypeMarker>::Borrowed<'_>

§

impl ValueTypeMarker for u32

§

type Borrowed<'a> = u32

§

fn borrow( value: &<u32 as TypeMarker>::Owned, ) -> <u32 as ValueTypeMarker>::Borrowed<'_>

§

impl ValueTypeMarker for u64

§

type Borrowed<'a> = u64

§

fn borrow( value: &<u64 as TypeMarker>::Owned, ) -> <u64 as ValueTypeMarker>::Borrowed<'_>

Implementors§

§

impl ValueTypeMarker for FrameworkErr

§

impl ValueTypeMarker for ObjectType

§

impl ValueTypeMarker for Rights

§

type Borrowed<'a> = Rights

§

impl ValueTypeMarker for WireMetadata

§

type Borrowed<'a> = &'a WireMetadata

§

impl ValueTypeMarker for Ambiguous1

§

impl ValueTypeMarker for Ambiguous2

§

impl ValueTypeMarker for EmptyPayload

§

type Borrowed<'a> = ()

§

impl ValueTypeMarker for EmptyStruct

§

type Borrowed<'a> = ()

§

impl ValueTypeMarker for EpitaphBody

§

type Borrowed<'a> = &'a EpitaphBody

§

impl ValueTypeMarker for TransactionHeader

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

type Borrowed<'a> = &'a str