pub struct BoundsImpl<B> { /* private fields */ }Expand description
Implementation based on dynamic bound B.
This struct provides the ability to type erase the implementation of drop, clone, and
Debug::fmt. This type should be stored by a vtable to provide the implementations for those
methods.
§Invariants
It is safe to transmute (either via the actual transmute function, or pointers)
from BoundsImpl<A> to BoundsImpl<B> where B: Subset<A> as given by
Subset. This allows for the implementation of
VTableSubset for borrows.
Implementations§
Source§impl<B: IsBound> BoundsImpl<B>
impl<B: IsBound> BoundsImpl<B>
Sourcepub const fn new<T: Dynamic<B>>() -> Self
pub const fn new<T: Dynamic<B>>() -> Self
Automatically extract the implementations from the type.
Self::drop_value()is always implemented usingdrop_in_place.Self::clone_value()will only be available ifBcontains theClonebound.Self::debug_value()will only be available ifBcontains theDebugbound.
Sourcepub const fn into_subset<Bnew>(self) -> BoundsImpl<Bnew>
pub const fn into_subset<Bnew>(self) -> BoundsImpl<Bnew>
Convert into a BoundsImpl with less trait bounds.
The implementations will remain the same. This is safe to do because only
adding traits to a bound could cause a implementation to be ran when it’s not
implemented already. Which can’t happen with the Bnew: Subset<B> bound.
Sourcepub unsafe fn drop_value(&self, data: *mut MaybeUninit<u8>)
pub unsafe fn drop_value(&self, data: *mut MaybeUninit<u8>)
Drop value.
The value will be invalid after calling this on it.
§Safety
The data buffer must contain a valid value of the type
this BoundsImpl was created for.
Sourcepub unsafe fn clone_value(
&self,
data: *const MaybeUninit<u8>,
data_other: *mut MaybeUninit<u8>,
)
pub unsafe fn clone_value( &self, data: *const MaybeUninit<u8>, data_other: *mut MaybeUninit<u8>, )
Clone value.
§Safety
B::BOUND_BY_CLONEmust betrueand/orB::CloneMarker: Clone.- The
databuffer must contain a valid value of the type thisBoundsImplwas created for. - The
data_otherbuffer must be large enough and aligned properly to store the value.
Sourcepub unsafe fn debug_value(
&self,
data: *const MaybeUninit<u8>,
f: &mut Formatter<'_>,
) -> Result<(), Error>
pub unsafe fn debug_value( &self, data: *const MaybeUninit<u8>, f: &mut Formatter<'_>, ) -> Result<(), Error>
Debug format value.
§Safety
B::BOUND_BY_DEBUGmust betrueand/orB::DebugMarker: Debug.- The
databuffer must contain a valid value of the type thisBoundsImplwas created for.
Trait Implementations§
Source§impl<B: Clone> Clone for BoundsImpl<B>
impl<B: Clone> Clone for BoundsImpl<B>
Source§fn clone(&self) -> BoundsImpl<B>
fn clone(&self) -> BoundsImpl<B>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<B: Copy> Copy for BoundsImpl<B>
Auto Trait Implementations§
impl<B> Freeze for BoundsImpl<B>
impl<B> RefUnwindSafe for BoundsImpl<B>where
B: RefUnwindSafe,
impl<B> Send for BoundsImpl<B>where
B: Send,
impl<B> Sync for BoundsImpl<B>where
B: Sync,
impl<B> Unpin for BoundsImpl<B>where
B: Unpin,
impl<B> UnwindSafe for BoundsImpl<B>where
B: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Dynamic<Bound<Send, Sync, Copy, Clone, Unpin, __>> for T
impl<T> Dynamic<Bound<Send, Sync, Copy, Clone, Unpin, __>> for T
Source§unsafe fn clone_unchecked(this: &T) -> T
unsafe fn clone_unchecked(this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<Send, Sync, Copy, Clone, __, __>> for T
impl<T> Dynamic<Bound<Send, Sync, Copy, Clone, __, __>> for T
Source§unsafe fn clone_unchecked(this: &T) -> T
unsafe fn clone_unchecked(this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<Send, Sync, Copy, __, Unpin, __>> for T
impl<T> Dynamic<Bound<Send, Sync, Copy, __, Unpin, __>> for T
Source§unsafe fn clone_unchecked(_this: &T) -> T
unsafe fn clone_unchecked(_this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<Send, Sync, Copy, __, __, __>> for T
impl<T> Dynamic<Bound<Send, Sync, Copy, __, __, __>> for T
Source§unsafe fn clone_unchecked(_this: &T) -> T
unsafe fn clone_unchecked(_this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<Send, Sync, __, Clone, Unpin, __>> for T
impl<T> Dynamic<Bound<Send, Sync, __, Clone, Unpin, __>> for T
Source§unsafe fn clone_unchecked(this: &T) -> T
unsafe fn clone_unchecked(this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<Send, Sync, __, Clone, __, __>> for T
impl<T> Dynamic<Bound<Send, Sync, __, Clone, __, __>> for T
Source§unsafe fn clone_unchecked(this: &T) -> T
unsafe fn clone_unchecked(this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<Send, Sync, __, __, Unpin, __>> for T
impl<T> Dynamic<Bound<Send, Sync, __, __, Unpin, __>> for T
Source§unsafe fn clone_unchecked(_this: &T) -> T
unsafe fn clone_unchecked(_this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<Send, Sync, __, __, __, __>> for T
impl<T> Dynamic<Bound<Send, Sync, __, __, __, __>> for T
Source§unsafe fn clone_unchecked(_this: &T) -> T
unsafe fn clone_unchecked(_this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<Send, __, Copy, Clone, Unpin, __>> for T
impl<T> Dynamic<Bound<Send, __, Copy, Clone, Unpin, __>> for T
Source§unsafe fn clone_unchecked(this: &T) -> T
unsafe fn clone_unchecked(this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<Send, __, Copy, Clone, __, __>> for T
impl<T> Dynamic<Bound<Send, __, Copy, Clone, __, __>> for T
Source§unsafe fn clone_unchecked(this: &T) -> T
unsafe fn clone_unchecked(this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<Send, __, Copy, __, Unpin, __>> for T
impl<T> Dynamic<Bound<Send, __, Copy, __, Unpin, __>> for T
Source§unsafe fn clone_unchecked(_this: &T) -> T
unsafe fn clone_unchecked(_this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<Send, __, Copy, __, __, __>> for T
impl<T> Dynamic<Bound<Send, __, Copy, __, __, __>> for T
Source§unsafe fn clone_unchecked(_this: &T) -> T
unsafe fn clone_unchecked(_this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<Send, __, __, Clone, Unpin, __>> for T
impl<T> Dynamic<Bound<Send, __, __, Clone, Unpin, __>> for T
Source§unsafe fn clone_unchecked(this: &T) -> T
unsafe fn clone_unchecked(this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<Send, __, __, Clone, __, __>> for T
impl<T> Dynamic<Bound<Send, __, __, Clone, __, __>> for T
Source§unsafe fn clone_unchecked(this: &T) -> T
unsafe fn clone_unchecked(this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<Send, __, __, __, Unpin, __>> for T
impl<T> Dynamic<Bound<Send, __, __, __, Unpin, __>> for T
Source§unsafe fn clone_unchecked(_this: &T) -> T
unsafe fn clone_unchecked(_this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<Send, __, __, __, __, __>> for Twhere
T: Send,
impl<T> Dynamic<Bound<Send, __, __, __, __, __>> for Twhere
T: Send,
Source§unsafe fn clone_unchecked(_this: &T) -> T
unsafe fn clone_unchecked(_this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<__, Sync, Copy, Clone, Unpin, __>> for T
impl<T> Dynamic<Bound<__, Sync, Copy, Clone, Unpin, __>> for T
Source§unsafe fn clone_unchecked(this: &T) -> T
unsafe fn clone_unchecked(this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<__, Sync, Copy, Clone, __, __>> for T
impl<T> Dynamic<Bound<__, Sync, Copy, Clone, __, __>> for T
Source§unsafe fn clone_unchecked(this: &T) -> T
unsafe fn clone_unchecked(this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<__, Sync, Copy, __, Unpin, __>> for T
impl<T> Dynamic<Bound<__, Sync, Copy, __, Unpin, __>> for T
Source§unsafe fn clone_unchecked(_this: &T) -> T
unsafe fn clone_unchecked(_this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<__, Sync, Copy, __, __, __>> for T
impl<T> Dynamic<Bound<__, Sync, Copy, __, __, __>> for T
Source§unsafe fn clone_unchecked(_this: &T) -> T
unsafe fn clone_unchecked(_this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<__, Sync, __, Clone, Unpin, __>> for T
impl<T> Dynamic<Bound<__, Sync, __, Clone, Unpin, __>> for T
Source§unsafe fn clone_unchecked(this: &T) -> T
unsafe fn clone_unchecked(this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<__, Sync, __, Clone, __, __>> for T
impl<T> Dynamic<Bound<__, Sync, __, Clone, __, __>> for T
Source§unsafe fn clone_unchecked(this: &T) -> T
unsafe fn clone_unchecked(this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<__, Sync, __, __, Unpin, __>> for T
impl<T> Dynamic<Bound<__, Sync, __, __, Unpin, __>> for T
Source§unsafe fn clone_unchecked(_this: &T) -> T
unsafe fn clone_unchecked(_this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<__, Sync, __, __, __, __>> for Twhere
T: Sync,
impl<T> Dynamic<Bound<__, Sync, __, __, __, __>> for Twhere
T: Sync,
Source§unsafe fn clone_unchecked(_this: &T) -> T
unsafe fn clone_unchecked(_this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<__, __, Copy, Clone, Unpin, __>> for T
impl<T> Dynamic<Bound<__, __, Copy, Clone, Unpin, __>> for T
Source§unsafe fn clone_unchecked(this: &T) -> T
unsafe fn clone_unchecked(this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<__, __, Copy, Clone, __, __>> for T
impl<T> Dynamic<Bound<__, __, Copy, Clone, __, __>> for T
Source§unsafe fn clone_unchecked(this: &T) -> T
unsafe fn clone_unchecked(this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<__, __, Copy, __, Unpin, __>> for T
impl<T> Dynamic<Bound<__, __, Copy, __, Unpin, __>> for T
Source§unsafe fn clone_unchecked(_this: &T) -> T
unsafe fn clone_unchecked(_this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<__, __, Copy, __, __, __>> for Twhere
T: Copy,
impl<T> Dynamic<Bound<__, __, Copy, __, __, __>> for Twhere
T: Copy,
Source§unsafe fn clone_unchecked(_this: &T) -> T
unsafe fn clone_unchecked(_this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<__, __, __, Clone, Unpin, __>> for T
impl<T> Dynamic<Bound<__, __, __, Clone, Unpin, __>> for T
Source§unsafe fn clone_unchecked(this: &T) -> T
unsafe fn clone_unchecked(this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<__, __, __, Clone, __, __>> for Twhere
T: Clone,
impl<T> Dynamic<Bound<__, __, __, Clone, __, __>> for Twhere
T: Clone,
Source§unsafe fn clone_unchecked(this: &T) -> T
unsafe fn clone_unchecked(this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<__, __, __, __, Unpin, __>> for Twhere
T: Unpin,
impl<T> Dynamic<Bound<__, __, __, __, Unpin, __>> for Twhere
T: Unpin,
Source§unsafe fn clone_unchecked(_this: &T) -> T
unsafe fn clone_unchecked(_this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read moreSource§impl<T> Dynamic<Bound<__, __, __, __, __, __>> for T
impl<T> Dynamic<Bound<__, __, __, __, __, __>> for T
Source§unsafe fn clone_unchecked(_this: &T) -> T
unsafe fn clone_unchecked(_this: &T) -> T
Self::clone(). Read moreSource§unsafe fn debug_unchecked(
_this: &T,
_f: &mut Formatter<'_>,
) -> Result<(), Error>
unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>
Self::debug(). Read more