TraitImpl

Struct TraitImpl 

Source
pub struct TraitImpl<TypeVars, Trait, Recv, Body> {
    pub type_variables: TypeVars,
    pub the_trait: Trait,
    pub receiver: Recv,
    pub body: Body,
}
Expand description

The implementation declaration for a trait, applying to a certain receiver.

Fields§

§type_variables: TypeVars

The type variables to use for the impl block itself. All type variables that appear later on the trait or the receiver must be declared here, per Rust language rules.

This field must be a sequence.

§the_trait: Trait

The trait being implemented

§receiver: Recv

The receiver for which it is implemented

§body: Body

The body. Use crate::common::NoOp if none exists.

Trait Implementations§

Source§

impl<O, TypeVars, Trait, Recv, Body> Writable<O> for TraitImpl<TypeVars, Trait, Recv, Body>
where O: Output, TypeVars: WritableSeq<O>, Trait: Writable<O>, Recv: Writable<O>, Body: Writable<O>,

Source§

async fn write_to(&self, o: &mut O) -> Result<(), O::Error>

Writes to the output. Returns the output’s error upon failure. Read more

Auto Trait Implementations§

§

impl<TypeVars, Trait, Recv, Body> Freeze for TraitImpl<TypeVars, Trait, Recv, Body>
where TypeVars: Freeze, Trait: Freeze, Recv: Freeze, Body: Freeze,

§

impl<TypeVars, Trait, Recv, Body> RefUnwindSafe for TraitImpl<TypeVars, Trait, Recv, Body>
where TypeVars: RefUnwindSafe, Trait: RefUnwindSafe, Recv: RefUnwindSafe, Body: RefUnwindSafe,

§

impl<TypeVars, Trait, Recv, Body> Send for TraitImpl<TypeVars, Trait, Recv, Body>
where TypeVars: Send, Trait: Send, Recv: Send, Body: Send,

§

impl<TypeVars, Trait, Recv, Body> Sync for TraitImpl<TypeVars, Trait, Recv, Body>
where TypeVars: Sync, Trait: Sync, Recv: Sync, Body: Sync,

§

impl<TypeVars, Trait, Recv, Body> Unpin for TraitImpl<TypeVars, Trait, Recv, Body>
where TypeVars: Unpin, Trait: Unpin, Recv: Unpin, Body: Unpin,

§

impl<TypeVars, Trait, Recv, Body> UnwindSafe for TraitImpl<TypeVars, Trait, Recv, Body>
where TypeVars: UnwindSafe, Trait: UnwindSafe, Recv: UnwindSafe, Body: 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

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.