Trait TakeFrom

pub trait TakeFrom<T>
where T: ?Sized,
{ const COPY_OPTIMIZATION: CopyOptimization<Self> = _; // Required method fn take_from(from: &T) -> Self; }
Expand description

From conversions which may take from a reference using interior mutability.

Provided Associated Constants§

const COPY_OPTIMIZATION: CopyOptimization<Self> = _

An optimization flag that allows the bytes of this type to be copied directly during conversion instead of calling take_from.

This optimization is disabled by default. To enable this optimization, you must unsafely attest that Self is trivially copyable using CopyOptimization::enable or CopyOptimization::enable_if.

Required Methods§

fn take_from(from: &T) -> Self

Converts from the given T, taking any resources that can’t be cloned.

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 TakeFrom<bool> for bool

§

impl TakeFrom<i8> for i8

§

impl TakeFrom<u8> for u8

§

impl TakeFrom<WireOptionalChannel> for Option<Channel>

§

impl TakeFrom<WireOptionalHandle> for Option<Bti>

§

impl TakeFrom<WireOptionalHandle> for Option<Channel>

§

impl TakeFrom<WireOptionalHandle> for Option<Clock>

§

impl TakeFrom<WireOptionalHandle> for Option<Event>

§

impl TakeFrom<WireOptionalHandle> for Option<EventPair>

§

impl TakeFrom<WireOptionalHandle> for Option<Exception>

§

impl TakeFrom<WireOptionalHandle> for Option<Fifo>

§

impl TakeFrom<WireOptionalHandle> for Option<Guest>

§

impl TakeFrom<WireOptionalHandle> for Option<Handle>

§

impl TakeFrom<WireOptionalHandle> for Option<Interrupt>

§

impl TakeFrom<WireOptionalHandle> for Option<Iob>

§

impl TakeFrom<WireOptionalHandle> for Option<Iommu>

§

impl TakeFrom<WireOptionalHandle> for Option<Job>

§

impl TakeFrom<WireOptionalHandle> for Option<Pager>

§

impl TakeFrom<WireOptionalHandle> for Option<Pmt>

§

impl TakeFrom<WireOptionalHandle> for Option<Port>

§

impl TakeFrom<WireOptionalHandle> for Option<Process>

§

impl TakeFrom<WireOptionalHandle> for Option<Profile>

§

impl TakeFrom<WireOptionalHandle> for Option<Resource>

§

impl TakeFrom<WireOptionalHandle> for Option<Socket>

§

impl TakeFrom<WireOptionalHandle> for Option<Stream>

§

impl TakeFrom<WireOptionalHandle> for Option<Thread>

§

impl TakeFrom<WireOptionalHandle> for Option<Timer>

§

impl TakeFrom<WireOptionalHandle> for Option<Vcpu>

§

impl TakeFrom<WireOptionalHandle> for Option<Vmar>

§

impl TakeFrom<WireOptionalHandle> for Option<Vmo>

§

impl TakeFrom<WireF32> for f32

§

impl TakeFrom<WireF64> for f64

§

impl TakeFrom<WireI16> for i16

§

impl TakeFrom<WireI32> for i32

§

impl TakeFrom<WireI64> for i64

§

impl TakeFrom<WireOptionalString> for Option<String>

§

impl TakeFrom<WireString> for String

§

impl TakeFrom<WireU16> for u16

§

impl TakeFrom<WireU32> for u32

§

impl TakeFrom<WireU64> for u64

§

impl<T, E, WT, WE> TakeFrom<WireResult<WT, WE>> for Result<T, E>
where T: TakeFrom<WT>, E: TakeFrom<WE>,

§

fn take_from(from: &WireResult<WT, WE>) -> Result<T, E>

§

impl<T, P1, P2> TakeFrom<ClientEnd<T, P1>> for Option<ClientEnd<P2>>
where Option<Channel>: TakeFrom<T>, P2: TakeFrom<P1>,

§

fn take_from(from: &ClientEnd<T, P1>) -> Option<ClientEnd<P2>>

§

impl<T, P1, P2> TakeFrom<ClientEnd<T, P1>> for ClientEnd<P2>
where Channel: TakeFrom<T>, P2: TakeFrom<P1>,

§

fn take_from(from: &ClientEnd<T, P1>) -> ClientEnd<P2>

§

impl<T, P1, P2> TakeFrom<ServerEnd<T, P1>> for Option<ServerEnd<P2>>
where Option<Channel>: TakeFrom<T>, P2: TakeFrom<P1>,

§

fn take_from(from: &ServerEnd<T, P1>) -> Option<ServerEnd<P2>>

§

impl<T, P1, P2> TakeFrom<ServerEnd<T, P1>> for ServerEnd<P2>
where Channel: TakeFrom<T>, P2: TakeFrom<P1>,

§

fn take_from(from: &ServerEnd<T, P1>) -> ServerEnd<P2>

§

impl<T, P, U> TakeFrom<ClientEnd<U, P>> for Option<ClientEnd<T, P>>
where Option<T>: TakeFrom<U>,

§

fn take_from(from: &ClientEnd<U, P>) -> Option<ClientEnd<T, P>>

§

impl<T, P, U> TakeFrom<ServerEnd<U, P>> for Option<ServerEnd<T, P>>
where Option<T>: TakeFrom<U>,

§

fn take_from(from: &ServerEnd<U, P>) -> Option<ServerEnd<T, P>>

§

impl<T, WT> TakeFrom<WireBox<WT>> for Option<T>
where T: TakeFrom<WT>,

§

fn take_from(from: &WireBox<WT>) -> Option<T>

§

impl<T, WT> TakeFrom<WireOptionalVector<WT>> for Option<Vec<T>>
where T: TakeFrom<WT>,

§

impl<T, WT> TakeFrom<WireVector<WT>> for Vec<T>
where T: TakeFrom<WT>,

§

fn take_from(from: &WireVector<WT>) -> Vec<T>

§

impl<T, WT> TakeFrom<WT> for Box<T>
where T: TakeFrom<WT>,

§

fn take_from(from: &WT) -> Box<T>

§

impl<T, WT, const N: usize> TakeFrom<[WT; N]> for [T; N]
where T: TakeFrom<WT>,

Implementors§

§

impl TakeFrom<WireChannel> for Channel

§

impl TakeFrom<WireF32> for WireF32

§

impl TakeFrom<WireF64> for WireF64

§

impl TakeFrom<WireFrameworkError> for FrameworkError

§

impl TakeFrom<WireI16> for WireI16

§

impl TakeFrom<WireI32> for WireI32

§

impl TakeFrom<WireI64> for WireI64

§

impl TakeFrom<WireU16> for WireU16

§

impl TakeFrom<WireU32> for WireU32

§

impl TakeFrom<WireU64> for WireU64

§

impl TakeFrom<WireHandle> for Bti

§

impl TakeFrom<WireHandle> for Channel

§

impl TakeFrom<WireHandle> for Clock

§

impl TakeFrom<WireHandle> for Event

§

impl TakeFrom<WireHandle> for EventPair

§

impl TakeFrom<WireHandle> for Exception

§

impl TakeFrom<WireHandle> for Fifo

§

impl TakeFrom<WireHandle> for Guest

§

impl TakeFrom<WireHandle> for Handle

§

impl TakeFrom<WireHandle> for Interrupt

§

impl TakeFrom<WireHandle> for Iob

§

impl TakeFrom<WireHandle> for Iommu

§

impl TakeFrom<WireHandle> for Job

§

impl TakeFrom<WireHandle> for Pager

§

impl TakeFrom<WireHandle> for Pmt

§

impl TakeFrom<WireHandle> for Port

§

impl TakeFrom<WireHandle> for Process

§

impl TakeFrom<WireHandle> for Profile

§

impl TakeFrom<WireHandle> for Resource

§

impl TakeFrom<WireHandle> for Socket

§

impl TakeFrom<WireHandle> for Stream

§

impl TakeFrom<WireHandle> for Thread

§

impl TakeFrom<WireHandle> for Timer

§

impl TakeFrom<WireHandle> for Vcpu

§

impl TakeFrom<WireHandle> for Vmar

§

impl TakeFrom<WireHandle> for Vmo

§

impl<T> TakeFrom<WireI64> for Instant<T>
where T: Timeline,

§

impl<T> TakeFrom<WireI64> for Instant<T, TicksUnit>
where T: Timeline,

§

impl<T, P, U> TakeFrom<ClientEnd<U, P>> for fidl_next::ClientEnd<T, P>
where T: TakeFrom<U>,

§

impl<T, P, U> TakeFrom<ServerEnd<U, P>> for fidl_next::ServerEnd<T, P>
where T: TakeFrom<U>,

§

impl<T, WT> TakeFrom<WireFlexible<WT>> for Flexible<T>
where T: TakeFrom<WT>,

§

impl<T, WT, E, WE> TakeFrom<WireFlexibleResult<WT, WE>> for FlexibleResult<T, E>
where T: TakeFrom<WT>, E: TakeFrom<WE>,