Skip to main content

PlaceBorrow

Trait PlaceBorrow 

Source
pub unsafe trait PlaceBorrow<'a, P, X>
where P: Projection + ?Sized, Self: HasPlace<Target = P::Source>, X: HasPlace<Target = P::Target>,
{ const BORROW_KIND: BorrowKind; // Required method unsafe fn borrow(ptr: *const Self, p: &P) -> X; }
Expand description

Borrow a subplace.

Required Associated Constants§

Source

const BORROW_KIND: BorrowKind

Tells the borrow-checker what other simultaneous and subsequent borrows are allowed.

Required Methods§

Source

unsafe fn borrow(ptr: *const Self, p: &P) -> X

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a, P: Projection + ?Sized> PlaceBorrow<'a, P, *const <P as Projection>::Target> for *const P::Source

Source§

const BORROW_KIND: BorrowKind = BorrowKind::Untracked

Source§

unsafe fn borrow(ptr: *const Self, p: &P) -> *const P::Target

Source§

impl<'a, P: Projection + ?Sized> PlaceBorrow<'a, P, *const <P as Projection>::Target> for *mut P::Source

Source§

const BORROW_KIND: BorrowKind = BorrowKind::Untracked

Source§

unsafe fn borrow(ptr: *const Self, p: &P) -> *const P::Target

Source§

impl<'a, P: Projection + ?Sized> PlaceBorrow<'a, P, *const <P as Projection>::Target> for NonNull<P::Source>

Source§

const BORROW_KIND: BorrowKind = BorrowKind::Untracked

Source§

unsafe fn borrow(ptr: *const Self, p: &P) -> *const P::Target

Source§

impl<'a, P: Projection + ?Sized> PlaceBorrow<'a, P, *mut <P as Projection>::Target> for *mut P::Source

Source§

const BORROW_KIND: BorrowKind = BorrowKind::Untracked

Source§

unsafe fn borrow(ptr: *const Self, p: &P) -> *mut P::Target

Source§

impl<'a, P: Projection + ?Sized> PlaceBorrow<'a, P, NonNull<<P as Projection>::Target>> for NonNull<P::Source>

Source§

const BORROW_KIND: BorrowKind = BorrowKind::Untracked

Source§

unsafe fn borrow(ptr: *const Self, p: &P) -> NonNull<P::Target>

Implementors§

Source§

impl<'a, P: Projection + ?Sized> PlaceBorrow<'a, P, *const <P as Projection>::Target> for &'_ P::Source

Source§

const BORROW_KIND: BorrowKind = BorrowKind::Untracked

Source§

impl<'a, P: Projection + ?Sized> PlaceBorrow<'a, P, *const <P as Projection>::Target> for &'_ mut P::Source

Source§

const BORROW_KIND: BorrowKind = BorrowKind::Untracked