Project

Trait Project 

Source
pub trait Project {
    type Base: ?Sized;
    type Output<'a, Field: 'a>
       where Self: 'a;

    // Required method
    unsafe fn project<'a, Field>(
        &'a self,
        project_field: fn(*const Self::Base) -> *const Field,
    ) -> Self::Output<'a, Field>;
}

Required Associated Types§

Source

type Base: ?Sized

Source

type Output<'a, Field: 'a> where Self: 'a

Required Methods§

Source

unsafe fn project<'a, Field>( &'a self, project_field: fn(*const Self::Base) -> *const Field, ) -> Self::Output<'a, Field>

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§

Source§

impl<P> Project for Pin<P>
where P: Deref,

[`Project’] is used to “project” a generic type onto a field of that type that’s wrapped.

Source§

type Base = <P as Deref>::Target

Source§

type Output<'a, Field: 'a> = Pin<&'a Field> where Self: 'a

Source§

unsafe fn project<'a, Field: ?Sized>( &'a self, project_field: fn(*const Self::Base) -> *const Field, ) -> Pin<&'a Field>

Source§

impl<T> Project for &T
where T: Project,

Source§

type Base = <T as Project>::Base

Source§

type Output<'a, Field: 'a> = <T as Project>::Output<'a, Field> where Self: 'a

Source§

unsafe fn project<'a, Field>( &'a self, project_field: fn(*const Self::Base) -> *const Field, ) -> Self::Output<'a, Field>

Source§

impl<T> Project for &mut T
where T: Project,

Source§

type Base = <T as Project>::Base

Source§

type Output<'a, Field: 'a> = <T as Project>::Output<'a, Field> where Self: 'a

Source§

unsafe fn project<'a, Field>( &'a self, project_field: fn(*const Self::Base) -> *const Field, ) -> Self::Output<'a, Field>

Source§

impl<T> Project for Box<T>
where T: Project,

Source§

type Base = <T as Project>::Base

Source§

type Output<'a, Field: 'a> = <T as Project>::Output<'a, Field> where Self: 'a

Source§

unsafe fn project<'a, Field>( &'a self, project_field: fn(*const Self::Base) -> *const Field, ) -> Self::Output<'a, Field>

Source§

impl<T> Project for MaybeUninit<T>

Source§

type Base = T

Source§

type Output<'a, Field: 'a> = &'a MaybeUninit<Field> where Self: 'a

Source§

unsafe fn project<'a, Field>( &'a self, project_field: fn(*const Self::Base) -> *const Field, ) -> &'a MaybeUninit<Field>

Implementors§