pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);Tuple Fields§
§0: Src§1: PhantomData<Dst>Implementations§
Source§impl<'a, Src, Dst> Wrap<&'a Src, &'a Dst>
impl<'a, Src, Dst> Wrap<&'a Src, &'a Dst>
Sourcepub const unsafe fn transmute_ref(self) -> &'a Dst
pub const unsafe fn transmute_ref(self) -> &'a Dst
Source§impl<'a, Src, Dst> Wrap<&'a mut Src, &'a mut Dst>
impl<'a, Src, Dst> Wrap<&'a mut Src, &'a mut Dst>
Sourcepub fn transmute_mut(self) -> &'a mut Dst
pub fn transmute_mut(self) -> &'a mut Dst
Transmutes a mutable reference of one type to a mutable reference of another type.
§PME
Instantiating this method PMEs unless both:
mem::size_of::<Dst>() == mem::size_of::<Src>()mem::align_of::<Dst>() <= mem::align_of::<Src>()
Trait Implementations§
Source§impl<'a, Src, Dst> TransmuteMutDst<'a> for Wrap<&'a mut Src, &'a mut Dst>where
Src: KnownLayout<PointerMetadata = usize> + FromBytes + IntoBytes + ?Sized,
Dst: KnownLayout<PointerMetadata = usize> + FromBytes + IntoBytes + ?Sized,
impl<'a, Src, Dst> TransmuteMutDst<'a> for Wrap<&'a mut Src, &'a mut Dst>where
Src: KnownLayout<PointerMetadata = usize> + FromBytes + IntoBytes + ?Sized,
Dst: KnownLayout<PointerMetadata = usize> + FromBytes + IntoBytes + ?Sized,
type Dst = Dst
fn transmute_mut(self) -> &'a mut Dst
Source§impl<'a, Src, Dst> TransmuteRefDst<'a> for Wrap<&'a Src, &'a Dst>where
Src: KnownLayout<PointerMetadata = usize> + IntoBytes + Immutable + ?Sized,
Dst: KnownLayout<PointerMetadata = usize> + FromBytes + Immutable + ?Sized,
impl<'a, Src, Dst> TransmuteRefDst<'a> for Wrap<&'a Src, &'a Dst>where
Src: KnownLayout<PointerMetadata = usize> + IntoBytes + Immutable + ?Sized,
Dst: KnownLayout<PointerMetadata = usize> + FromBytes + Immutable + ?Sized,
impl<Src: Copy, Dst: Copy> Copy for Wrap<Src, Dst>
Auto Trait Implementations§
impl<Src, Dst> Freeze for Wrap<Src, Dst>where
Src: Freeze,
impl<Src, Dst> RefUnwindSafe for Wrap<Src, Dst>where
Src: RefUnwindSafe,
Dst: RefUnwindSafe,
impl<Src, Dst> Send for Wrap<Src, Dst>
impl<Src, Dst> Sync for Wrap<Src, Dst>
impl<Src, Dst> Unpin for Wrap<Src, Dst>
impl<Src, Dst> UnwindSafe for Wrap<Src, Dst>where
Src: UnwindSafe,
Dst: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)] const SIZE: usize = _
#[doc(hidden)] const SIZE: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)] const ALIGN: usize = _
#[doc(hidden)] const ALIGN: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)] const IS_ZST: bool = _
#[doc(hidden)] const IS_ZST: bool = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)] const LAYOUT: Layout = _
#[doc(hidden)] const LAYOUT: Layout = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)] const MAX_SLICE_LEN: usize = _
#[doc(hidden)] const MAX_SLICE_LEN: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties)The largest safe length for a
[Self]. Read more