Skip to main contentCrate zr
Source - define_opaque_storage_ffi
- Defines an opaque C++ storage type with explicit size, alignment, and an FFI
init function. - pin_init_ffi
- A helper macro to initialize a pinned object in-place using a raw FFI constructor.
- static_assert
- Compile-time assertion.
Fails to compile if the condition is false.
- static_assert_size_and_align
- Compile-time assertion that a type’s size is <=
max_size and alignment == expected_align. - unsafe_pinned_drop_ffi
- A helper macro to implement
PinnedDrop using a raw FFI destructor.
- AtomicConstPtr
- An atomic pointer type which operates on
*const T. - Deferred
- A guard that executes an action when dropped, unless cancelled.
- InlineFn
- An inline-stored, partially type-erased
Fn closure with compile-time capacity SIZE. - InlineFnMut
- An inline-stored, partially type-erased
FnMut closure with compile-time capacity SIZE. - InlineFnOnce
- An inline-stored, partially type-erased
FnOnce closure with compile-time capacity SIZE. - Local
- Marker type for closures that do not require
Send or Sync. - Opaque
- A wrapper for types that are opaque to Rust.
- OpaqueFacade
- A zero-sized type representing an opaque C++ object facade.
- SendOnly
- Marker type for closures that implement
Send (but not necessarily Sync). - SendSync
- Marker type for closures that implement both
Send and Sync.
- DEFAULT_INLINE_FN_SIZE
- Default inline storage capacity in bytes (3 machine words, e.g. 24 bytes on 64-bit platforms).
- FnMutWithSig
- Trait implemented by closures that can be invoked mutably with signature
Sig. - FnOnceWithSig
- Trait implemented by closures that can be invoked once with signature
Sig. - FnSig
- Trait implemented for supported function pointer signature types (e.g.,
fn(A, B) -> Ret). - FnWithSig
- Trait implemented by closures that can be invoked by shared reference with signature
Sig. - ThreadSafety
- Sealed trait enforcing the required
Send / Sync bounds on a closure F for a given
thread-safety marker (Local, SendOnly, or SendSync). - ToMutPtr
- Extension trait for references to obtain a mutable raw pointer.
- defer
- Schedules an action to be executed when the returned guard is dropped.
- from_utf8_lossy
- Wraps a binary string that may contain non-UTF-8 bytes for formatting.
Invalid bytes are formatted as
\u{FFFFD}. - parse_usize
- Parse a decimal integer from a string slice at compile time.
- slice_from_raw_parts⚠
- Forms a slice from an FFI pointer and a length, returning an empty slice
&[] when len == 0
even if data is null or misaligned. - slice_from_raw_parts_mut⚠
- Performs the same functionality as
slice_from_raw_parts, except that a mutable slice is
returned. - to_array
- Copy a string slice into a fixed-size byte array at compile time, leaving space for a null
terminator.
- OpaqueBytes
- A generic, safe opaque storage container with exact const size constraints.
- SendInlineFn
- Type alias for an
InlineFn that is Send (but !Sync). - SendInlineFnMut
- Type alias for an
InlineFnMut that is Send (but !Sync). - SendInlineFnOnce
- Type alias for an
InlineFnOnce that is Send (but !Sync). - SendSyncInlineFn
- Type alias for an
InlineFn that is both Send and Sync. - SendSyncInlineFnMut
- Type alias for an
InlineFnMut that is both Send and Sync. - SendSyncInlineFnOnce
- Type alias for an
InlineFnOnce that is both Send and Sync.