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§
impl Immutable for bool
impl Immutable for char
impl Immutable for f16
Available on crate feature
float-nightly only.impl Immutable for f32
impl Immutable for f64
impl Immutable for f128
Available on crate feature
float-nightly only.impl Immutable for i8
impl Immutable for i16
impl Immutable for i32
impl Immutable for i64
impl Immutable for i128
impl Immutable for isize
impl Immutable for str
impl Immutable for u8
impl Immutable for u16
impl Immutable for u32
impl Immutable for u64
impl Immutable for u128
impl Immutable for ()
impl Immutable for usize
impl Immutable for float64x1_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for float64x2_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for float32x2_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for float32x4_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for int8x8_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for int8x8x2_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for int8x8x3_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for int8x8x4_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for int8x16_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for int8x16x2_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for int8x16x3_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for int8x16x4_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for int16x4_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for int16x8_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for int32x2_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for int32x4_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for int64x1_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for int64x2_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for poly8x8_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for poly8x8x2_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for poly8x8x3_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for poly8x8x4_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for poly8x16_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for poly8x16x2_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for poly8x16x3_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for poly8x16x4_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for poly16x4_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for poly16x8_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for poly64x1_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for poly64x2_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for uint8x8_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for uint8x8x2_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for uint8x8x3_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for uint8x8x4_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for uint8x16_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for uint8x16x2_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for uint8x16x3_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for uint8x16x4_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for uint16x4_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for uint16x4x2_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for uint16x4x3_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for uint16x4x4_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for uint16x8_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for uint32x2_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for uint32x4_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for uint64x1_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for uint64x2_t
Available on AArch64 and little-endian and
rust=1.59.0 and crate feature simd only.impl Immutable for NonZeroI8
impl Immutable for NonZeroI16
impl Immutable for NonZeroI32
impl Immutable for NonZeroI64
impl Immutable for NonZeroI128
impl Immutable for NonZeroIsize
impl Immutable for NonZeroU8
impl Immutable for NonZeroU16
impl Immutable for NonZeroU32
impl Immutable for NonZeroU64
impl Immutable for NonZeroU128
impl Immutable for NonZeroUsize
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<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, 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<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<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<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<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<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<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<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<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<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<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<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<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<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<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<F, G, H, I, J, K, L, M> Immutable for Option<unsafe extern "C" fn(F, 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<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<G, H, I, J, K, L, M> Immutable for Option<unsafe extern "C" fn(G, 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<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<H, I, J, K, L, M> Immutable for Option<unsafe extern "C" fn(H, 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<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<I, J, K, L, M> Immutable for Option<unsafe extern "C" fn(I, 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<extern "C" fn(J, K, L) -> M>
impl<J, K, L, M> Immutable for Option<unsafe fn(J, K, L) -> M>
impl<J, K, L, M> Immutable for Option<unsafe extern "C" fn(J, K, L) -> M>
impl<K, L, M> Immutable for Option<fn(K, L) -> M>
impl<K, L, M> Immutable for Option<extern "C" fn(K, L) -> M>
impl<K, L, M> Immutable for Option<unsafe fn(K, L) -> M>
impl<K, L, M> Immutable for Option<unsafe extern "C" fn(K, L) -> M>
impl<L, M> Immutable for Option<fn(L) -> M>
impl<L, M> Immutable for Option<extern "C" fn(L) -> M>
impl<L, M> Immutable for Option<unsafe fn(L) -> M>
impl<L, M> Immutable for Option<unsafe extern "C" fn(L) -> M>
impl<M> Immutable for Option<fn() -> M>
impl<M> Immutable for Option<extern "C" fn() -> M>
impl<M> Immutable for Option<unsafe fn() -> M>
impl<M> Immutable for Option<unsafe extern "C" fn() -> M>
impl<T: Sized> Immutable for Box<T>
Available on crate feature
alloc only.