Trait Immutable
pub unsafe trait Immutable
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.:
# use 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.
Implementors
impl Immutable for ()impl Immutable for NonZeroI128impl Immutable for NonZeroI16impl Immutable for NonZeroI32impl Immutable for NonZeroI64impl Immutable for NonZeroI8impl Immutable for NonZeroIsizeimpl Immutable for NonZeroU128impl Immutable for NonZeroU16impl Immutable for NonZeroU32impl Immutable for NonZeroU64impl Immutable for NonZeroU8impl Immutable for NonZeroUsizeimpl Immutable for __m128impl Immutable for __m128dimpl Immutable for __m128iimpl Immutable for __m256impl Immutable for __m256dimpl Immutable for __m256iimpl Immutable for __m512impl Immutable for __m512bhimpl Immutable for __m512dimpl Immutable for __m512iimpl Immutable for boolimpl Immutable for charimpl Immutable for f32impl Immutable for f64impl Immutable for i128impl Immutable for i16impl Immutable for i32impl Immutable for i64impl Immutable for i8impl Immutable for isizeimpl Immutable for strimpl Immutable for u128impl Immutable for u16impl Immutable for u32impl Immutable for u64impl Immutable for u8impl Immutable for usizeimpl<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>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>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>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>impl<A: Immutable> Immutable for (A,)impl<A: Immutable, B: Immutable> Immutable for (A, B)impl<A: Immutable, B: Immutable, C: Immutable> Immutable for (A, B, C)impl<A: Immutable, B: Immutable, C: Immutable, D: Immutable> Immutable for (A, B, C, D)impl<A: Immutable, B: Immutable, C: Immutable, D: Immutable, E: Immutable> Immutable for (A, B, C, D, E)impl<A: Immutable, B: Immutable, C: Immutable, D: Immutable, E: Immutable, F: Immutable> Immutable for (A, B, C, D, E, F)impl<A: Immutable, B: Immutable, C: Immutable, D: Immutable, E: Immutable, F: Immutable, G: Immutable> Immutable for (A, B, C, D, E, F, G)impl<A: Immutable, B: Immutable, C: Immutable, D: Immutable, E: Immutable, F: Immutable, G: Immutable, H: Immutable> Immutable for (A, B, C, D, E, F, G, H)impl<A: Immutable, B: Immutable, C: Immutable, D: Immutable, E: Immutable, F: Immutable, G: Immutable, H: Immutable, I: Immutable> Immutable for (A, B, C, D, E, F, G, H, I)impl<A: Immutable, B: Immutable, C: Immutable, D: Immutable, E: Immutable, F: Immutable, G: Immutable, H: Immutable, I: Immutable, J: Immutable> Immutable for (A, B, C, D, E, F, G, H, I, J)impl<A: Immutable, B: Immutable, C: Immutable, D: Immutable, E: Immutable, F: Immutable, G: Immutable, H: Immutable, I: Immutable, J: Immutable, K: Immutable> Immutable for (A, B, C, D, E, F, G, H, I, J, K)impl<A: Immutable, B: Immutable, C: Immutable, D: Immutable, E: Immutable, F: Immutable, G: Immutable, H: Immutable, I: Immutable, J: Immutable, K: Immutable, L: Immutable> Immutable for (A, B, C, D, E, F, G, H, I, J, K, L)impl<A: Immutable, B: Immutable, C: Immutable, D: Immutable, E: Immutable, F: Immutable, G: Immutable, H: Immutable, I: Immutable, J: Immutable, K: Immutable, L: Immutable, M: Immutable> Immutable for (A, B, C, D, E, F, G, H, I, J, K, L, M)impl<A: Immutable, B: Immutable, C: Immutable, D: Immutable, E: Immutable, F: Immutable, G: Immutable, H: Immutable, I: Immutable, J: Immutable, K: Immutable, L: Immutable, M: Immutable, N: Immutable> Immutable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N)impl<A: Immutable, B: Immutable, C: Immutable, D: Immutable, E: Immutable, F: Immutable, G: Immutable, H: Immutable, I: Immutable, J: Immutable, K: Immutable, L: Immutable, M: Immutable, N: Immutable, O: Immutable> Immutable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)impl<A: Immutable, B: Immutable, C: Immutable, D: Immutable, E: Immutable, F: Immutable, G: Immutable, H: Immutable, I: Immutable, J: Immutable, K: Immutable, L: Immutable, M: Immutable, N: Immutable, O: Immutable, P: Immutable> Immutable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)impl<A: Immutable, B: Immutable, C: Immutable, D: Immutable, E: Immutable, F: Immutable, G: Immutable, H: Immutable, I: Immutable, J: Immutable, K: Immutable, L: Immutable, M: Immutable, N: Immutable, O: Immutable, P: Immutable, Q: Immutable> Immutable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)impl<A: Immutable, B: Immutable, C: Immutable, D: Immutable, E: Immutable, F: Immutable, G: Immutable, H: Immutable, I: Immutable, J: Immutable, K: Immutable, L: Immutable, M: Immutable, N: Immutable, O: Immutable, P: Immutable, Q: Immutable, R: Immutable> Immutable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)impl<A: Immutable, B: Immutable, C: Immutable, D: Immutable, E: Immutable, F: Immutable, G: Immutable, H: Immutable, I: Immutable, J: Immutable, K: Immutable, L: Immutable, M: Immutable, N: Immutable, O: Immutable, P: Immutable, Q: Immutable, R: Immutable, S: Immutable> Immutable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)impl<A: Immutable, B: Immutable, C: Immutable, D: Immutable, E: Immutable, F: Immutable, G: Immutable, H: Immutable, I: Immutable, J: Immutable, K: Immutable, L: Immutable, M: Immutable, N: Immutable, O: Immutable, P: Immutable, Q: Immutable, R: Immutable, S: Immutable, T: Immutable> Immutable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)impl<A: Immutable, B: Immutable, C: Immutable, D: Immutable, E: Immutable, F: Immutable, G: Immutable, H: Immutable, I: Immutable, J: Immutable, K: Immutable, L: Immutable, M: Immutable, N: Immutable, O: Immutable, P: Immutable, Q: Immutable, R: Immutable, S: Immutable, T: Immutable, U: Immutable> Immutable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U)impl<A: Immutable, B: Immutable, C: Immutable, D: Immutable, E: Immutable, F: Immutable, G: Immutable, H: Immutable, I: Immutable, J: Immutable, K: Immutable, L: Immutable, M: Immutable, N: Immutable, O: Immutable, P: Immutable, Q: Immutable, R: Immutable, S: Immutable, T: Immutable, U: Immutable, V: Immutable> Immutable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V)impl<A: Immutable, B: Immutable, C: Immutable, D: Immutable, E: Immutable, F: Immutable, G: Immutable, H: Immutable, I: Immutable, J: Immutable, K: Immutable, L: Immutable, M: Immutable, N: Immutable, O: Immutable, P: Immutable, Q: Immutable, R: Immutable, S: Immutable, T: Immutable, U: Immutable, V: Immutable, W: Immutable> Immutable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W)impl<A: Immutable, B: Immutable, C: Immutable, D: Immutable, E: Immutable, F: Immutable, G: Immutable, H: Immutable, I: Immutable, J: Immutable, K: Immutable, L: Immutable, M: Immutable, N: Immutable, O: Immutable, P: Immutable, Q: Immutable, R: Immutable, S: Immutable, T: Immutable, U: Immutable, V: Immutable, W: Immutable, X: Immutable> Immutable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X)impl<A: Immutable, B: Immutable, C: Immutable, D: Immutable, E: Immutable, F: Immutable, G: Immutable, H: Immutable, I: Immutable, J: Immutable, K: Immutable, L: Immutable, M: Immutable, N: Immutable, O: Immutable, P: Immutable, Q: Immutable, R: Immutable, S: Immutable, T: Immutable, U: Immutable, V: Immutable, W: Immutable, X: Immutable, Y: Immutable> Immutable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y)impl<A: Immutable, B: Immutable, C: Immutable, D: Immutable, E: Immutable, F: Immutable, G: Immutable, H: Immutable, I: Immutable, J: Immutable, K: Immutable, L: Immutable, M: Immutable, N: Immutable, O: Immutable, P: Immutable, Q: Immutable, R: Immutable, S: Immutable, T: Immutable, U: Immutable, V: Immutable, W: Immutable, X: Immutable, Y: Immutable, Z: Immutable> Immutable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)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>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>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>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>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>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>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>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>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>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>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>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>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>impl<E, F, G, H, I, J, K, L, M> Immutable for Option<fn(E, F, G, H, I, J, K, L) -> M>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>impl<E, F, G, H, I, J, K, L, M> Immutable for Option<unsafe fn(E, F, G, H, I, J, K, L) -> M>impl<F, G, H, I, J, K, L, M> Immutable for Option<extern "C" fn(F, G, H, I, J, K, L) -> M>impl<F, G, H, I, J, K, L, M> Immutable for Option<fn(F, G, H, I, J, K, L) -> M>impl<F, G, H, I, J, K, L, M> Immutable for Option<unsafe extern "C" fn(F, G, H, I, J, K, L) -> M>impl<F, G, H, I, J, K, L, M> Immutable for Option<unsafe fn(F, G, H, I, J, K, L) -> M>impl<G, H, I, J, K, L, M> Immutable for Option<extern "C" fn(G, H, I, J, K, L) -> M>impl<G, H, I, J, K, L, M> Immutable for Option<fn(G, H, I, J, K, L) -> M>impl<G, H, I, J, K, L, M> Immutable for Option<unsafe extern "C" fn(G, H, I, J, K, L) -> M>impl<G, H, I, J, K, L, M> Immutable for Option<unsafe fn(G, H, I, J, K, L) -> M>impl<H, I, J, K, L, M> Immutable for Option<extern "C" fn(H, I, J, K, L) -> M>impl<H, I, J, K, L, M> Immutable for Option<fn(H, I, J, K, L) -> M>impl<H, I, J, K, L, M> Immutable for Option<unsafe extern "C" fn(H, I, J, K, L) -> M>impl<H, I, J, K, L, M> Immutable for Option<unsafe fn(H, I, J, K, L) -> M>impl<I, J, K, L, M> Immutable for Option<extern "C" fn(I, J, K, L) -> M>impl<I, J, K, L, M> Immutable for Option<fn(I, J, K, L) -> M>impl<I, J, K, L, M> Immutable for Option<unsafe extern "C" fn(I, J, K, L) -> M>impl<I, J, K, L, M> Immutable for Option<unsafe fn(I, J, K, L) -> M>impl<J, K, L, M> Immutable for Option<extern "C" fn(J, K, L) -> M>impl<J, K, L, M> Immutable for Option<fn(J, K, L) -> M>impl<J, K, L, M> Immutable for Option<unsafe extern "C" fn(J, K, L) -> M>impl<J, K, L, M> Immutable for Option<unsafe fn(J, K, L) -> M>impl<K, L, M> Immutable for Option<extern "C" fn(K, L) -> M>impl<K, L, M> Immutable for Option<fn(K, L) -> M>impl<K, L, M> Immutable for Option<unsafe extern "C" fn(K, L) -> M>impl<K, L, M> Immutable for Option<unsafe fn(K, L) -> M>impl<L, M> Immutable for Option<extern "C" fn(L) -> M>impl<L, M> Immutable for Option<fn(L) -> M>impl<L, M> Immutable for Option<unsafe extern "C" fn(L) -> M>impl<L, M> Immutable for Option<unsafe fn(L) -> M>impl<M> Immutable for Option<extern "C" fn() -> M>impl<M> Immutable for Option<fn() -> M>impl<M> Immutable for Option<unsafe extern "C" fn() -> M>impl<M> Immutable for Option<unsafe fn() -> M>impl<O> Immutable for F32<O> where [u8; 4]: Immutable, PhantomData<O>: Immutable,impl<O> Immutable for F64<O> where [u8; 8]: Immutable, PhantomData<O>: Immutable,impl<O> Immutable for I128<O> where [u8; 16]: Immutable, PhantomData<O>: Immutable,impl<O> Immutable for I16<O> where [u8; 2]: Immutable, PhantomData<O>: Immutable,impl<O> Immutable for I32<O> where [u8; 4]: Immutable, PhantomData<O>: Immutable,impl<O> Immutable for I64<O> where [u8; 8]: Immutable, PhantomData<O>: Immutable,impl<O> Immutable for Isize<O> where [u8; 8]: Immutable, PhantomData<O>: Immutable,impl<O> Immutable for U128<O> where [u8; 16]: Immutable, PhantomData<O>: Immutable,impl<O> Immutable for U16<O> where [u8; 2]: Immutable, PhantomData<O>: Immutable,impl<O> Immutable for U32<O> where [u8; 4]: Immutable, PhantomData<O>: Immutable,impl<O> Immutable for U64<O> where [u8; 8]: Immutable, PhantomData<O>: Immutable,impl<O> Immutable for Usize<O> where [u8; 8]: Immutable, PhantomData<O>: Immutable,impl<T> Immutable for Unalign<T> where T: Immutable,impl<T: ?Sized + Immutable> Immutable for ManuallyDrop<T>impl<T: ?Sized> Immutable for &Timpl<T: ?Sized> Immutable for &mut Timpl<T: ?Sized> Immutable for *const Timpl<T: ?Sized> Immutable for *mut Timpl<T: ?Sized> Immutable for NonNull<T>impl<T: ?Sized> Immutable for PhantomData<T>impl<T: ?Sized> Immutable for ReadOnly<T>impl<T: Immutable> Immutable for CoreMaybeUninit<T>impl<T: Immutable> Immutable for Option<T>impl<T: Immutable> Immutable for Wrapping<T>impl<T: Immutable> Immutable for [T]impl<T: Immutable, const N: usize> Immutable for [T; N]