Skip to main content

Safe

Enum Safe 

Source
pub enum Safe {}
Available on zerocopy_unstable_ptr only.
Expand description

The referent of a Ptr<T> is valid for T, upholding bit validity and any library safety invariants.

Trait Implementations§

Source§

impl Sealed for Safe

Source§

impl<T> TransmuteFrom<*mut T, Safe, Safe> for AtomicPtr<T>

Available on rust=1.60.0 and target_has_atomic=ptr only.
Source§

impl<T> TransmuteFrom<Atomic<*mut T>, Safe, Safe> for *mut T

Available on rust=1.60.0 and target_has_atomic=ptr only.
Source§

impl<T> TransmuteFrom<Atomic<*mut T>, Safe, Safe> for UnsafeCell<*mut T>

Available on rust=1.60.0 and target_has_atomic=ptr only.
Source§

impl TransmuteFrom<Atomic<bool>, Safe, Safe> for bool

Available on rust=1.60.0 and target_has_atomic=8 only.
Source§

impl TransmuteFrom<Atomic<bool>, Safe, Safe> for UnsafeCell<bool>

Available on rust=1.60.0 and target_has_atomic=8 only.
Source§

impl TransmuteFrom<Atomic<i8>, Safe, Safe> for i8

Available on rust=1.60.0 and target_has_atomic=8 only.
Source§

impl TransmuteFrom<Atomic<i8>, Safe, Safe> for UnsafeCell<i8>

Available on rust=1.60.0 and target_has_atomic=8 only.
Source§

impl TransmuteFrom<Atomic<i16>, Safe, Safe> for i16

Available on rust=1.60.0 and target_has_atomic=16 only.
Source§

impl TransmuteFrom<Atomic<i16>, Safe, Safe> for UnsafeCell<i16>

Available on rust=1.60.0 and target_has_atomic=16 only.
Source§

impl TransmuteFrom<Atomic<i32>, Safe, Safe> for i32

Available on rust=1.60.0 and target_has_atomic=32 only.
Source§

impl TransmuteFrom<Atomic<i32>, Safe, Safe> for UnsafeCell<i32>

Available on rust=1.60.0 and target_has_atomic=32 only.
Source§

impl TransmuteFrom<Atomic<i64>, Safe, Safe> for i64

Available on rust=1.60.0 and target_has_atomic=64 only.
Source§

impl TransmuteFrom<Atomic<i64>, Safe, Safe> for UnsafeCell<i64>

Available on rust=1.60.0 and target_has_atomic=64 only.
Source§

impl TransmuteFrom<Atomic<isize>, Safe, Safe> for isize

Available on rust=1.60.0 and target_has_atomic=ptr only.
Source§

impl TransmuteFrom<Atomic<isize>, Safe, Safe> for UnsafeCell<isize>

Available on rust=1.60.0 and target_has_atomic=ptr only.
Source§

impl TransmuteFrom<Atomic<u8>, Safe, Safe> for u8

Available on rust=1.60.0 and target_has_atomic=8 only.
Source§

impl TransmuteFrom<Atomic<u8>, Safe, Safe> for UnsafeCell<u8>

Available on rust=1.60.0 and target_has_atomic=8 only.
Source§

impl TransmuteFrom<Atomic<u16>, Safe, Safe> for u16

Available on rust=1.60.0 and target_has_atomic=16 only.
Source§

impl TransmuteFrom<Atomic<u16>, Safe, Safe> for UnsafeCell<u16>

Available on rust=1.60.0 and target_has_atomic=16 only.
Source§

impl TransmuteFrom<Atomic<u32>, Safe, Safe> for u32

Available on rust=1.60.0 and target_has_atomic=32 only.
Source§

impl TransmuteFrom<Atomic<u32>, Safe, Safe> for UnsafeCell<u32>

Available on rust=1.60.0 and target_has_atomic=32 only.
Source§

impl TransmuteFrom<Atomic<u64>, Safe, Safe> for u64

Available on rust=1.60.0 and target_has_atomic=64 only.
Source§

impl TransmuteFrom<Atomic<u64>, Safe, Safe> for UnsafeCell<u64>

Available on rust=1.60.0 and target_has_atomic=64 only.
Source§

impl TransmuteFrom<Atomic<usize>, Safe, Safe> for usize

Available on rust=1.60.0 and target_has_atomic=ptr only.
Source§

impl TransmuteFrom<Atomic<usize>, Safe, Safe> for UnsafeCell<usize>

Available on rust=1.60.0 and target_has_atomic=ptr only.
Source§

impl<T> TransmuteFrom<Cell<T>, Safe, Safe> for UnsafeCell<T>

Source§

impl<T> TransmuteFrom<MaybeUninit<T>, Safe, Safe> for Wrapping<T>

Source§

impl<T: ?Sized> TransmuteFrom<T, Safe, Safe> for ManuallyDrop<T>

Source§

impl<T> TransmuteFrom<T, Safe, Safe> for Unalign<T>

Source§

impl<T> TransmuteFrom<T, Safe, Safe> for Wrapping<T>

Source§

impl<T: ?Sized> TransmuteFrom<T, Safe, Safe> for UnsafeCell<T>

Source§

impl<T: ?Sized> TransmuteFrom<T, Safe, Safe> for Cell<T>

Source§

impl<T: ?Sized> TransmuteFrom<T, Safe, Safe> for ReadOnly<T>

Source§

impl<T> TransmuteFrom<T, Uninit, Safe> for MaybeUninit<T>

Source§

impl<T> TransmuteFrom<UnsafeCell<*mut T>, Safe, Safe> for AtomicPtr<T>

Available on rust=1.60.0 and target_has_atomic=ptr only.
Source§

impl<T> TransmuteFrom<UnsafeCell<T>, Safe, Safe> for Cell<T>

Source§

impl TransmuteFrom<UnsafeCell<bool>, Safe, Safe> for AtomicBool

Available on rust=1.60.0 and target_has_atomic=8 only.
Source§

impl TransmuteFrom<UnsafeCell<i8>, Safe, Safe> for AtomicI8

Available on rust=1.60.0 and target_has_atomic=8 only.
Source§

impl TransmuteFrom<UnsafeCell<i16>, Safe, Safe> for AtomicI16

Available on rust=1.60.0 and target_has_atomic=16 only.
Source§

impl TransmuteFrom<UnsafeCell<i32>, Safe, Safe> for AtomicI32

Available on rust=1.60.0 and target_has_atomic=32 only.
Source§

impl TransmuteFrom<UnsafeCell<i64>, Safe, Safe> for AtomicI64

Available on rust=1.60.0 and target_has_atomic=64 only.
Source§

impl TransmuteFrom<UnsafeCell<isize>, Safe, Safe> for AtomicIsize

Available on rust=1.60.0 and target_has_atomic=ptr only.
Source§

impl TransmuteFrom<UnsafeCell<u8>, Safe, Safe> for AtomicU8

Available on rust=1.60.0 and target_has_atomic=8 only.
Source§

impl TransmuteFrom<UnsafeCell<u16>, Safe, Safe> for AtomicU16

Available on rust=1.60.0 and target_has_atomic=16 only.
Source§

impl TransmuteFrom<UnsafeCell<u32>, Safe, Safe> for AtomicU32

Available on rust=1.60.0 and target_has_atomic=32 only.
Source§

impl TransmuteFrom<UnsafeCell<u64>, Safe, Safe> for AtomicU64

Available on rust=1.60.0 and target_has_atomic=64 only.
Source§

impl TransmuteFrom<UnsafeCell<usize>, Safe, Safe> for AtomicUsize

Available on rust=1.60.0 and target_has_atomic=ptr only.
Source§

impl<T> TransmuteFrom<Wrapping<T>, Safe, Safe> for MaybeUninit<T>

Source§

impl TransmuteFrom<bool, Safe, Safe> for AtomicBool

Available on rust=1.60.0 and target_has_atomic=8 only.
Source§

impl TransmuteFrom<i8, Safe, Safe> for AtomicI8

Available on rust=1.60.0 and target_has_atomic=8 only.
Source§

impl TransmuteFrom<i16, Safe, Safe> for AtomicI16

Available on rust=1.60.0 and target_has_atomic=16 only.
Source§

impl TransmuteFrom<i32, Safe, Safe> for AtomicI32

Available on rust=1.60.0 and target_has_atomic=32 only.
Source§

impl TransmuteFrom<i64, Safe, Safe> for AtomicI64

Available on rust=1.60.0 and target_has_atomic=64 only.
Source§

impl TransmuteFrom<isize, Safe, Safe> for AtomicIsize

Available on rust=1.60.0 and target_has_atomic=ptr only.
Source§

impl TransmuteFrom<u8, Safe, Safe> for AtomicU8

Available on rust=1.60.0 and target_has_atomic=8 only.
Source§

impl TransmuteFrom<u16, Safe, Safe> for AtomicU16

Available on rust=1.60.0 and target_has_atomic=16 only.
Source§

impl TransmuteFrom<u32, Safe, Safe> for AtomicU32

Available on rust=1.60.0 and target_has_atomic=32 only.
Source§

impl TransmuteFrom<u64, Safe, Safe> for AtomicU64

Available on rust=1.60.0 and target_has_atomic=64 only.
Source§

impl TransmuteFrom<usize, Safe, Safe> for AtomicUsize

Available on rust=1.60.0 and target_has_atomic=ptr only.
Source§

impl Validity for Safe

Source§

const KIND: ValidityKind = ValidityKind::Safe

Auto Trait Implementations§

§

impl Freeze for Safe

§

impl RefUnwindSafe for Safe

§

impl Send for Safe

§

impl Sync for Safe

§

impl Unpin for Safe

§

impl UnsafeUnpin for Safe

§

impl UnwindSafe for Safe

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Identity for T
where T: ?Sized,

Source§

type Type = T

Self.
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<Src, Dst, A, SV, DV, R> MutationCompatible<Src, A, SV, DV, (BecauseRead, R)> for Dst
where A: Aliasing, SV: Validity, DV: Validity, Src: Read<A, R> + ?Sized, Dst: Read<A, R> + ?Sized,

Source§

impl<Src, Dst, A, SV, DV> MutationCompatible<Src, A, SV, DV, BecauseSharedCompatible> for Dst
where A: Aliasing, SV: Validity, DV: Validity, Src: TransmuteFrom<Dst, DV, SV> + ?Sized, Dst: TransmuteFrom<Src, SV, DV> + SharedCompatible<Src> + ?Sized,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> SharedCompatible<ManuallyDrop<T>> for T
where T: ?Sized,

Source§

impl<T> SharedCompatible<T> for T
where T: ?Sized,

Source§

impl<T> SharedCompatible<Unalign<T>> for T

Source§

impl<T> SharedCompatible<Wrapping<T>> for T

Source§

impl<T> SizeEq<Cell<T>> for T
where T: ?Sized,

Source§

type CastFrom = CastFromWrapper

Available on zerocopy_unstable_ptr only.
Source§

impl<T> SizeEq<ManuallyDrop<T>> for T
where T: ?Sized,

Source§

type CastFrom = CastFromWrapper

Available on zerocopy_unstable_ptr only.
Source§

impl<T> SizeEq<MaybeUninit<T>> for T

Source§

type CastFrom = CastSizedExact

Available on zerocopy_unstable_ptr only.
Source§

impl<T> SizeEq<ReadOnly<T>> for T
where T: ?Sized,

Source§

type CastFrom = CastFromReadOnly

Available on zerocopy_unstable_ptr only.
Source§

impl<T> SizeEq<T> for T
where T: ?Sized,

Source§

type CastFrom = IdCast

Available on zerocopy_unstable_ptr only.
Source§

impl<T> SizeEq<Unalign<T>> for T

Source§

type CastFrom = CastFromWrapper

Available on zerocopy_unstable_ptr only.
Source§

impl<T> SizeEq<UnsafeCell<T>> for T
where T: ?Sized,

Source§

type CastFrom = CastFromWrapper

Available on zerocopy_unstable_ptr only.
Source§

impl<T> SizeEq<Wrapping<T>> for T

Source§

type CastFrom = CastFromWrapper

Available on zerocopy_unstable_ptr only.
Source§

impl<T> SizeHint for T
where T: ?Sized,

Source§

default fn lower_bound(&self) -> usize

🔬This is a nightly-only experimental API. (core_io_internals)
Returns a lower bound on the number of elements this container-like item contains. For example, an array [u8; 12] could return any value between 0 and 12 inclusively as a correct implementation. Read more
Source§

default fn upper_bound(&self) -> Option<usize>

🔬This is a nightly-only experimental API. (core_io_internals)
Returns an upper bound on the number of elements this container-like item contains if it can be determined, otherwise None. Read more
Source§

final fn size_hint(&self) -> (usize, Option<usize>)

🔬This is a nightly-only experimental API. (core_io_internals)
Returns an estimate for the number of elements this container like type contains. Read more
Source§

impl<T> Sized for T

Source§

impl<T> SizedTypeProperties for T

Source§

#[doc(hidden)]
const SIZE: usize = _

🔬This is a nightly-only experimental API. (sized_type_properties)
Source§

#[doc(hidden)]
const ALIGN: usize = _

🔬This is a nightly-only experimental API. (sized_type_properties)
Source§

#[doc(hidden)]
const ALIGNMENT: Alignment = _

🔬This is a nightly-only experimental API. (ptr_alignment_type)
Source§

#[doc(hidden)]
const IS_ZST: bool = _

🔬This is a nightly-only experimental API. (sized_type_properties)
true if this type requires no storage. false if its size is greater than zero. Read more
Source§

#[doc(hidden)]
const LAYOUT: Layout = _

🔬This is a nightly-only experimental API. (sized_type_properties)
Source§

#[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
Source§

impl<T> TransmuteFrom<Cell<T>, Safe, Safe> for T
where T: ?Sized,

Source§

impl<T> TransmuteFrom<ManuallyDrop<T>, Safe, Safe> for T
where T: ?Sized,

Source§

impl<T> TransmuteFrom<ReadOnly<T>, Safe, Safe> for T
where T: ?Sized,

Source§

impl<Src, Dst> TransmuteFrom<Src, Initialized, Initialized> for Dst
where Src: ?Sized, Dst: ?Sized,

Source§

impl<Src, Dst> TransmuteFrom<Src, Initialized, Safe> for Dst
where Dst: FromBytes + ?Sized, Src: ?Sized,

Source§

impl<Src, Dst> TransmuteFrom<Src, Safe, Initialized> for Dst
where Src: IntoBytes + ?Sized, Dst: ?Sized,

Source§

impl<Src, Dst, V> TransmuteFrom<Src, V, Uninit> for Dst
where V: Validity, Src: ?Sized, Dst: ?Sized,

Source§

impl<T> TransmuteFrom<Unalign<T>, Safe, Safe> for T

Source§

impl<T> TransmuteFrom<UnsafeCell<T>, Safe, Safe> for T
where T: ?Sized,

Source§

impl<T> TransmuteFrom<Wrapping<T>, Safe, Safe> for T

Source§

impl<Src, Dst, A, SV, DV, C, R> TransmuteFromPtr<Src, A, SV, DV, C, R> for Dst
where A: Aliasing, SV: Validity, DV: Validity, C: CastExact<Src, Dst>, Dst: TransmuteFrom<Src, SV, DV> + TryTransmuteFromPtr<Src, A, SV, DV, C, R> + ?Sized, Src: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<Src, Dst, SV, DV, A, C, R> TryTransmuteFromPtr<Src, A, SV, DV, C, (BecauseMutationCompatible, R)> for Dst
where A: Aliasing, SV: Validity, DV: Validity, Src: TransmuteFrom<Dst, DV, SV> + ?Sized, Dst: MutationCompatible<Src, A, SV, DV, R> + ?Sized, C: CastExact<Src, Dst>,