pub enum PointerCoercion {
ReifyFnPointer,
UnsafeFnPointer,
ClosureFnPointer(Safety),
MutToConstPointer,
ArrayToPointer,
Unsize,
}
Variants§
ReifyFnPointer
Go from a fn-item type to a fn-pointer type.
UnsafeFnPointer
Go from a safe fn pointer to an unsafe fn pointer.
ClosureFnPointer(Safety)
Go from a non-capturing closure to a fn pointer or an unsafe fn pointer. It cannot convert a closure that requires unsafe.
MutToConstPointer
Go from a mut raw pointer to a const raw pointer.
ArrayToPointer
Go from *const [T; N]
to *const T
Unsize
Unsize a pointer/reference value, e.g., &[T; n]
to
&[T]
. Note that the source could be a thin or wide pointer.
This will do things like convert thin pointers to wide
pointers, or convert structs containing thin pointers to
structs containing wide pointers, or convert between wide
pointers.
Trait Implementations§
Source§impl Clone for PointerCoercion
impl Clone for PointerCoercion
Source§fn clone(&self) -> PointerCoercion
fn clone(&self) -> PointerCoercion
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for PointerCoercion
impl Debug for PointerCoercion
Source§impl PartialEq for PointerCoercion
impl PartialEq for PointerCoercion
Source§impl Serialize for PointerCoercion
impl Serialize for PointerCoercion
impl Copy for PointerCoercion
impl Eq for PointerCoercion
impl StructuralPartialEq for PointerCoercion
Auto Trait Implementations§
impl Freeze for PointerCoercion
impl RefUnwindSafe for PointerCoercion
impl Send for PointerCoercion
impl Sync for PointerCoercion
impl Unpin for PointerCoercion
impl UnwindSafe for PointerCoercion
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,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 1 byte
Size for each variant:
ReifyFnPointer
: 0 bytesUnsafeFnPointer
: 0 bytesClosureFnPointer
: 1 byteMutToConstPointer
: 0 bytesArrayToPointer
: 0 bytesUnsize
: 0 bytes