Skip to main content

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 f32

Source§

impl Immutable for f64

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 __m128

Source§

impl Immutable for __m128d

Source§

impl Immutable for __m128i

Source§

impl Immutable for __m256

Source§

impl Immutable for __m256d

Source§

impl Immutable for __m256i

Source§

impl Immutable for __m512

Source§

impl Immutable for __m512bh

Source§

impl Immutable for __m512d

Source§

impl Immutable for __m512i

Source§

impl Immutable for NonZero<i8>

Source§

impl Immutable for NonZero<i16>

Source§

impl Immutable for NonZero<i32>

Source§

impl Immutable for NonZero<i64>

Source§

impl Immutable for NonZero<i128>

Source§

impl Immutable for NonZero<isize>

Source§

impl Immutable for NonZero<u8>

Source§

impl Immutable for NonZero<u16>

Source§

impl Immutable for NonZero<u32>

Source§

impl Immutable for NonZero<u64>

Source§

impl Immutable for NonZero<u128>

Source§

impl Immutable for NonZero<usize>

§

impl Immutable for BtiInfo
where u64: Immutable,

§

impl Immutable for HandleCountInfo
where u32: Immutable,

§

impl Immutable for InfoMapsTypeUnion
where zx_info_maps_mapping_t: Immutable,

§

impl Immutable for Koid
where u64: Immutable,

§

impl Immutable for MapInfo
where Name: Immutable, usize: Immutable, u32: Immutable, InfoMapsTypeUnion: Immutable,

§

impl Immutable for MappingDetails
where VmarFlagsExtended: Immutable, [PadByte; 4]: Immutable, Koid: Immutable, u64: Immutable, usize: Immutable,

§

impl Immutable for MemStats
where u64: Immutable,

§

impl Immutable for MemStatsCompression

§

impl Immutable for MemStatsExtended
where u64: Immutable,

§

impl Immutable for MemoryStall
where i64: Immutable,

§

impl Immutable for Name
where [u8; 32]: Immutable,

§

impl Immutable for PadByte
where u8: Immutable,

§

impl Immutable for PerCpuStats

§

impl Immutable for ProcessHandleStats
where [u32; 64]: Immutable,

§

impl Immutable for ProcessInfo
where i64: Immutable, Instant<MonotonicTimeline>: Immutable, ProcessInfoFlags: Immutable, [PadByte; 4]: Immutable,

§

impl Immutable for ProcessInfoFlags
where u32: Immutable,

§

impl Immutable for ResourceInfo

§

impl Immutable for Rights
where u32: Immutable,

§

impl Immutable for TaskRuntimeInfo
where i64: Immutable,

§

impl Immutable for TaskStatsInfo

§

impl Immutable for VmarFlags
where u32: Immutable,

§

impl Immutable for VmarFlagsExtended
where u32: Immutable,

§

impl Immutable for VmarInfo

§

impl Immutable for VmoInfo
where Koid: Immutable, Name: Immutable, u64: Immutable, usize: Immutable, VmoInfoFlags: Immutable, [PadByte; 4]: Immutable, Rights: Immutable, u32: Immutable,

§

impl Immutable for VmoInfoFlags
where u32: Immutable,

§

impl Immutable for priority_params
where i32: Immutable, [PadByte; 20]: Immutable,

§

impl Immutable for zx_arm64_exc_data_t
where u32: Immutable, [PadByte; 4]: Immutable, u64: Immutable, [PadByte; 8]: Immutable,

§

impl Immutable for zx_cpu_set_t
where [u64; 8]: Immutable,

§

impl Immutable for zx_exception_context_t
where zx_exception_header_arch_t: Immutable, u32: Immutable,

§

impl Immutable for zx_exception_header_arch_t
where zx_x86_64_exc_data_t: Immutable, zx_arm64_exc_data_t: Immutable, zx_riscv64_exc_data_t: Immutable,

§

impl Immutable for zx_exception_header_t
where u32: Immutable,

§

impl Immutable for zx_exception_info_t
where u64: Immutable, u32: Immutable, [PadByte; 4]: Immutable,

§

impl Immutable for zx_exception_report_t
where zx_exception_header_t: Immutable, zx_exception_context_t: Immutable,

§

impl Immutable for zx_info_bti_t
where u64: Immutable,

§

impl Immutable for zx_info_cpu_stats_t

§

impl Immutable for zx_info_handle_basic_t
where u64: Immutable, u32: Immutable, [PadByte; 4]: Immutable,

§

impl Immutable for zx_info_handle_count_t
where u32: Immutable,

§

impl Immutable for zx_info_job_t

§

impl Immutable for zx_info_kmem_stats_compression_t

§

impl Immutable for zx_info_kmem_stats_extended_t
where u64: Immutable,

§

impl Immutable for zx_info_kmem_stats_t
where u64: Immutable,

§

impl Immutable for zx_info_maps_mapping_t
where u32: Immutable, [PadByte; 4]: Immutable, u64: Immutable, usize: Immutable,

§

impl Immutable for zx_info_maps_t
where [u8; 32]: Immutable, usize: Immutable, u32: Immutable, InfoMapsTypeUnion: Immutable,

§

impl Immutable for zx_info_memory_stall_t
where i64: Immutable,

§

impl Immutable for zx_info_process_handle_stats_t
where [u32; 64]: Immutable,

§

impl Immutable for zx_info_process_t

§

impl Immutable for zx_info_resource_t

§

impl Immutable for zx_info_socket_t

§

impl Immutable for zx_info_task_runtime_t
where i64: Immutable,

§

impl Immutable for zx_info_task_stats_t

§

impl Immutable for zx_info_thread_stats_t

§

impl Immutable for zx_info_thread_t
where u32: Immutable, zx_cpu_set_t: Immutable,

§

impl Immutable for zx_info_timer_t

§

impl Immutable for zx_info_vmar_t

§

impl Immutable for zx_info_vmo_t

§

impl Immutable for zx_log_record_t

§

impl Immutable for zx_packet_guest_vcpu_interrupt_t
where u64: Immutable, u8: Immutable, [PadByte; 7]: Immutable,

§

impl Immutable for zx_packet_guest_vcpu_startup_t

§

impl Immutable for zx_packet_guest_vcpu_union_t
where zx_packet_guest_vcpu_interrupt_t: Immutable, zx_packet_guest_vcpu_startup_t: Immutable,

§

impl Immutable for zx_profile_info_union
where priority_params: Immutable, zx_sched_deadline_params_t: Immutable,

§

impl Immutable for zx_riscv64_exc_data_t
where u64: Immutable, [PadByte; 8]: Immutable,

§

impl Immutable for zx_rseq_t

§

impl Immutable for zx_sched_deadline_params_t
where i64: Immutable,

§

impl Immutable for zx_thread_state_general_regs_t
where u64: Immutable,

§

impl Immutable for zx_x86_64_exc_data_t
where u64: Immutable,

Source§

impl<A> Immutable for (A,)
where A: Immutable,

Source§

impl<A, B> Immutable for (A, B)
where A: Immutable, B: Immutable,

Source§

impl<A, B, C> Immutable for (A, B, C)
where A: Immutable, B: Immutable, C: Immutable,

Source§

impl<A, B, C, D> Immutable for (A, B, C, D)
where A: Immutable, B: Immutable, C: Immutable, D: Immutable,

Source§

impl<A, B, C, D, E> Immutable for (A, B, C, D, E)
where A: Immutable, B: Immutable, C: Immutable, D: Immutable, E: Immutable,

Source§

impl<A, B, C, D, E, F> Immutable for (A, B, C, D, E, F)

Source§

impl<A, B, C, D, E, F, G> Immutable for (A, B, C, D, E, F, G)

Source§

impl<A, B, C, D, E, F, G, H> Immutable for (A, B, C, D, E, F, G, H)

Source§

impl<A, B, C, D, E, F, G, H, I> Immutable for (A, B, C, D, E, F, G, H, I)

Source§

impl<A, B, C, D, E, F, G, H, I, J> Immutable for (A, B, C, D, E, F, G, H, I, J)

Source§

impl<A, B, C, D, E, F, G, H, I, J, K> Immutable for (A, B, C, D, E, F, G, H, I, J, K)

Source§

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

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<A, B, C, D, E, F, G, H, I, J, K, L, M> Immutable for (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, N> Immutable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N)

Source§

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

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P> Immutable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q> Immutable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R> Immutable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S> Immutable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T> Immutable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U> Immutable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U)

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V> Immutable for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V)

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W> 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)

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X> 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)

Source§

impl<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> 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)

Source§

impl<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> 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)

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> Immutable for Option<T>
where T: Immutable,

Source§

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

Source§

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

Source§

impl<T> Immutable for &T
where T: ?Sized,

Source§

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

Source§

impl<T> Immutable for [T]
where T: Immutable,

Source§

impl<T> Immutable for Box<T>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

§

impl<T> Immutable for TimerInfo<T>
where T: Timeline, u32: Immutable, Instant<T>: Immutable, Duration<T>: Immutable,

§

impl<T, U> Immutable for Duration<T, U>

§

impl<T, U> Immutable for Instant<T, U>

Source§

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

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 U64<O>

Source§

impl<O> Immutable for U128<O>

Source§

impl<O> Immutable for Usize<O>

Source§

impl<O> Immutable for U16<O>

Source§

impl<O> Immutable for U32<O>

Source§

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

Source§

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