Immutable

Trait Immutable 

Source
pub unsafe trait Immutable { }
Expand description

Types which are free from interior mutability.

T: Immutable indicates that T does not permit interior mutation, except by ownership or an exclusive (&mut) borrow.

§Implementation

Do not implement this trait yourself! Instead, use #[derive(Immutable)] (requires the derive Cargo feature); e.g.:

#[derive(Immutable)]
struct MyStruct {
    ...
}

#[derive(Immutable)]
enum MyEnum {
    ...
}

#[derive(Immutable)]
union MyUnion {
    ...
}

This derive performs a sophisticated, compile-time safety analysis to determine whether a type is Immutable.

§Safety

Unsafe code outside of this crate must not make any assumptions about T based on T: Immutable. We reserve the right to relax the requirements for Immutable in the future, and if unsafe code outside of this crate makes assumptions based on T: Immutable, future relaxations may cause that code to become unsound.

Implementations on Foreign Types§

Source§

impl Immutable for bool

Source§

impl Immutable for char

Source§

impl Immutable for f16

Available on crate feature float-nightly only.
Source§

impl Immutable for f32

Source§

impl Immutable for f64

Source§

impl Immutable for f128

Available on crate feature float-nightly only.
Source§

impl Immutable for i8

Source§

impl Immutable for i16

Source§

impl Immutable for i32

Source§

impl Immutable for i64

Source§

impl Immutable for i128

Source§

impl Immutable for isize

Source§

impl Immutable for str

Source§

impl Immutable for u8

Source§

impl Immutable for u16

Source§

impl Immutable for u32

Source§

impl Immutable for u64

Source§

impl Immutable for u128

Source§

impl Immutable for ()

Source§

impl Immutable for usize

Source§

impl Immutable for float64x1_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for float64x2_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for float32x2_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for float32x4_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for int8x8_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for int8x8x2_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for int8x8x3_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for int8x8x4_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for int8x16_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for int8x16x2_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for int8x16x3_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for int8x16x4_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for int16x4_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for int16x8_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for int32x2_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for int32x4_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for int64x1_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for int64x2_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for poly8x8_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for poly8x8x2_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for poly8x8x3_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for poly8x8x4_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for poly8x16_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for poly8x16x2_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for poly8x16x3_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for poly8x16x4_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for poly16x4_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for poly16x8_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for poly64x1_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for poly64x2_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for uint8x8_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for uint8x8x2_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for uint8x8x3_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for uint8x8x4_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for uint8x16_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for uint8x16x2_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for uint8x16x3_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for uint8x16x4_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for uint16x4_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for uint16x4x2_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for uint16x4x3_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for uint16x4x4_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for uint16x8_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for uint32x2_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for uint32x4_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for uint64x1_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for uint64x2_t

Available on AArch64 and little-endian and rust=1.59.0 and crate feature simd only.
Source§

impl Immutable for NonZeroI8

Source§

impl Immutable for NonZeroI16

Source§

impl Immutable for NonZeroI32

Source§

impl Immutable for NonZeroI64

Source§

impl Immutable for NonZeroI128

Source§

impl Immutable for NonZeroIsize

Source§

impl Immutable for NonZeroU8

Source§

impl Immutable for NonZeroU16

Source§

impl Immutable for NonZeroU32

Source§

impl Immutable for NonZeroU64

Source§

impl Immutable for NonZeroU128

Source§

impl Immutable for NonZeroUsize

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M> Immutable for Option<fn(A, B, C, D, E, F, G, H, I, J, K, L) -> M>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M> Immutable for Option<extern "C" fn(A, B, C, D, E, F, G, H, I, J, K, L) -> M>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M> Immutable for Option<unsafe fn(A, B, C, D, E, F, G, H, I, J, K, L) -> M>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M> Immutable for Option<unsafe extern "C" fn(A, B, C, D, E, F, G, H, I, J, K, L) -> M>

Source§

impl<B, C, D, E, F, G, H, I, J, K, L, M> Immutable for Option<fn(B, C, D, E, F, G, H, I, J, K, L) -> M>

Source§

impl<B, C, D, E, F, G, H, I, J, K, L, M> Immutable for Option<extern "C" fn(B, C, D, E, F, G, H, I, J, K, L) -> M>

Source§

impl<B, C, D, E, F, G, H, I, J, K, L, M> Immutable for Option<unsafe fn(B, C, D, E, F, G, H, I, J, K, L) -> M>

Source§

impl<B, C, D, E, F, G, H, I, J, K, L, M> Immutable for Option<unsafe extern "C" fn(B, C, D, E, F, G, H, I, J, K, L) -> M>

Source§

impl<C, D, E, F, G, H, I, J, K, L, M> Immutable for Option<fn(C, D, E, F, G, H, I, J, K, L) -> M>

Source§

impl<C, D, E, F, G, H, I, J, K, L, M> Immutable for Option<extern "C" fn(C, D, E, F, G, H, I, J, K, L) -> M>

Source§

impl<C, D, E, F, G, H, I, J, K, L, M> Immutable for Option<unsafe fn(C, D, E, F, G, H, I, J, K, L) -> M>

Source§

impl<C, D, E, F, G, H, I, J, K, L, M> Immutable for Option<unsafe extern "C" fn(C, D, E, F, G, H, I, J, K, L) -> M>

Source§

impl<D, E, F, G, H, I, J, K, L, M> Immutable for Option<fn(D, E, F, G, H, I, J, K, L) -> M>

Source§

impl<D, E, F, G, H, I, J, K, L, M> Immutable for Option<extern "C" fn(D, E, F, G, H, I, J, K, L) -> M>

Source§

impl<D, E, F, G, H, I, J, K, L, M> Immutable for Option<unsafe fn(D, E, F, G, H, I, J, K, L) -> M>

Source§

impl<D, E, F, G, H, I, J, K, L, M> Immutable for Option<unsafe extern "C" fn(D, E, F, G, H, I, J, K, L) -> M>

Source§

impl<E, F, G, H, I, J, K, L, M> Immutable for Option<fn(E, F, G, H, I, J, K, L) -> M>

Source§

impl<E, F, G, H, I, J, K, L, M> Immutable for Option<extern "C" fn(E, F, G, H, I, J, K, L) -> M>

Source§

impl<E, F, G, H, I, J, K, L, M> Immutable for Option<unsafe fn(E, F, G, H, I, J, K, L) -> M>

Source§

impl<E, F, G, H, I, J, K, L, M> Immutable for Option<unsafe extern "C" fn(E, F, G, H, I, J, K, L) -> M>

Source§

impl<F, G, H, I, J, K, L, M> Immutable for Option<fn(F, G, H, I, J, K, L) -> M>

Source§

impl<F, G, H, I, J, K, L, M> Immutable for Option<extern "C" fn(F, G, H, I, J, K, L) -> M>

Source§

impl<F, G, H, I, J, K, L, M> Immutable for Option<unsafe fn(F, G, H, I, J, K, L) -> M>

Source§

impl<F, G, H, I, J, K, L, M> Immutable for Option<unsafe extern "C" fn(F, G, H, I, J, K, L) -> M>

Source§

impl<G, H, I, J, K, L, M> Immutable for Option<fn(G, H, I, J, K, L) -> M>

Source§

impl<G, H, I, J, K, L, M> Immutable for Option<extern "C" fn(G, H, I, J, K, L) -> M>

Source§

impl<G, H, I, J, K, L, M> Immutable for Option<unsafe fn(G, H, I, J, K, L) -> M>

Source§

impl<G, H, I, J, K, L, M> Immutable for Option<unsafe extern "C" fn(G, H, I, J, K, L) -> M>

Source§

impl<H, I, J, K, L, M> Immutable for Option<fn(H, I, J, K, L) -> M>

Source§

impl<H, I, J, K, L, M> Immutable for Option<extern "C" fn(H, I, J, K, L) -> M>

Source§

impl<H, I, J, K, L, M> Immutable for Option<unsafe fn(H, I, J, K, L) -> M>

Source§

impl<H, I, J, K, L, M> Immutable for Option<unsafe extern "C" fn(H, I, J, K, L) -> M>

Source§

impl<I, J, K, L, M> Immutable for Option<fn(I, J, K, L) -> M>

Source§

impl<I, J, K, L, M> Immutable for Option<extern "C" fn(I, J, K, L) -> M>

Source§

impl<I, J, K, L, M> Immutable for Option<unsafe fn(I, J, K, L) -> M>

Source§

impl<I, J, K, L, M> Immutable for Option<unsafe extern "C" fn(I, J, K, L) -> M>

Source§

impl<J, K, L, M> Immutable for Option<fn(J, K, L) -> M>

Source§

impl<J, K, L, M> Immutable for Option<extern "C" fn(J, K, L) -> M>

Source§

impl<J, K, L, M> Immutable for Option<unsafe fn(J, K, L) -> M>

Source§

impl<J, K, L, M> Immutable for Option<unsafe extern "C" fn(J, K, L) -> M>

Source§

impl<K, L, M> Immutable for Option<fn(K, L) -> M>

Source§

impl<K, L, M> Immutable for Option<extern "C" fn(K, L) -> M>

Source§

impl<K, L, M> Immutable for Option<unsafe fn(K, L) -> M>

Source§

impl<K, L, M> Immutable for Option<unsafe extern "C" fn(K, L) -> M>

Source§

impl<L, M> Immutable for Option<fn(L) -> M>

Source§

impl<L, M> Immutable for Option<extern "C" fn(L) -> M>

Source§

impl<L, M> Immutable for Option<unsafe fn(L) -> M>

Source§

impl<L, M> Immutable for Option<unsafe extern "C" fn(L) -> M>

Source§

impl<M> Immutable for Option<fn() -> M>

Source§

impl<M> Immutable for Option<extern "C" fn() -> M>

Source§

impl<M> Immutable for Option<unsafe fn() -> M>

Source§

impl<M> Immutable for Option<unsafe extern "C" fn() -> M>

Source§

impl<T: Sized> Immutable for Box<T>

Available on crate feature alloc only.
Source§

impl<T: Immutable> Immutable for Option<T>

Source§

impl<T: Immutable> Immutable for [T]

Source§

impl<T: Immutable> Immutable for Wrapping<T>

Source§

impl<T: Immutable> Immutable for CoreMaybeUninit<T>

Source§

impl<T: Immutable, const N: usize> Immutable for [T; N]

Source§

impl<T: ?Sized + Immutable> Immutable for ManuallyDrop<T>

Source§

impl<T: ?Sized> Immutable for *const T

Source§

impl<T: ?Sized> Immutable for *mut T

Source§

impl<T: ?Sized> Immutable for &T

Source§

impl<T: ?Sized> Immutable for &mut T

Source§

impl<T: ?Sized> Immutable for PhantomData<T>

Source§

impl<T: ?Sized> Immutable for NonNull<T>

Implementors§

Source§

impl<O> Immutable for F32<O>

Source§

impl<O> Immutable for F64<O>

Source§

impl<O> Immutable for I16<O>

Source§

impl<O> Immutable for I32<O>

Source§

impl<O> Immutable for I64<O>

Source§

impl<O> Immutable for I128<O>

Source§

impl<O> Immutable for Isize<O>

Source§

impl<O> Immutable for U16<O>

Source§

impl<O> Immutable for U32<O>

Source§

impl<O> Immutable for U64<O>

Source§

impl<O> Immutable for U128<O>

Source§

impl<O> Immutable for Usize<O>

Source§

impl<T> Immutable for Unalign<T>
where T: Immutable,