[][src]Crate lokacore

Lokathor's crate of core-only odds and ends.

Re-exports

pub use math::*;

Modules

arch

Architecture specific functionality, safe wrapped.

math

This module is for math utils missing from core.

Macros

branchless_abs

The wrapping absolute value of any signed integer.

branchless_force_bits

Force bits of an unsigned value off or on.

branchless_masked_merge

Bitwise merge two values according to a bit mask.

branchless_max

The maximum of two integer values.

branchless_min

The minimum of two integer values.

branchless_negate

Negate a signed integer value or not.

branchless_opposite_sign

If two signed values have opposite sign (zero counts as positive).

branchless_pow_of_2_or_zero

If an unsigned value is a power of 2 (or is 0).

shuffle128

Shuffles around some f32 lanes into a new m128

shuffle128d

Shuffles around some f64 lanes into a new m128d

Structs

Align2

Wrap the inner value to a minimum alignment of 2.

Align4

Wrap the inner value to a minimum alignment of 4.

Align8

Wrap the inner value to a minimum alignment of 8.

Align16

Wrap the inner value to a minimum alignment of 16.

Align32

Wrap the inner value to a minimum alignment of 32.

Enums

PodCastError

The things that can go wrong when casting between Pod data forms.

Traits

Pod

Marker trait for "plain old data".

Zeroable

Trait for types that can be safely created with zeroed.

Functions

bytes_of

Re-interprets &T as &[u8].

bytes_of_mut

Re-interprets &mut T as &mut [u8].

cast

Cast T into U

cast_mut

Cast &mut T into &mut U.

cast_ref

Cast &T into &U.

cast_slice

Cast &[T] into &[U].

cast_slice_mut

Cast &mut [T] into &mut [U].

pod_align_to

As align_to, but safe because of the Pod bound.

pod_align_to_mut

As align_to_mut, but safe because of the Pod bound.

try_cast

Try to cast T into U.

try_cast_mut

Try to convert a &mut T into &mut U.

try_cast_ref

Try to convert a &T into &U.

try_cast_slice

Try to convert &[T] into &[U] (possibly with a change in length).

try_cast_slice_mut

Try to convert &mut [T] into mut [U] (possibly with a change in length).