Module zerocopy

Module zerocopy 

Source

Modules§

byte_slice
Traits for types that encapsulate a [u8].
byteorder
Byte order-aware numeric primitives.
error
Types related to error reporting.

Macros§

include_value
Includes a file and safely transmutes it to a value of an arbitrary type.
transmute
Safely transmutes a value of one type to a value of another type of the same size.
transmute_mut
Safely transmutes a mutable reference of one type to a mutable reference of another type of the same size and compatible alignment.
transmute_ref
Safely transmutes a mutable or immutable reference of one type to an immutable reference of another type of the same size and compatible alignment.
try_transmute
Conditionally transmutes a value of one type to a value of another type of the same size.
try_transmute_mut
Conditionally transmutes a mutable reference of one type to a mutable reference of another type of the same size and compatible alignment.
try_transmute_ref
Conditionally transmutes a mutable or immutable reference of one type to an immutable reference of another type of the same size and compatible alignment.

Structs§

AlignmentError
The error emitted if the conversion source is improperly aligned.
AllocError
The error type of a failed allocation.
F32
A 32-bit floating point number stored in a given byte order.
F64
A 64-bit floating point number stored in a given byte order.
I16
I32
I64
I128
Isize
A word-sized signed integer stored in a given byte order.
Ptr
A raw pointer with more restrictions.
Ref
A typed reference derived from a byte slice.
SizeError
The error emitted if the conversion source is of incorrect size.
Split
A T that has been split into two possibly-overlapping parts.
U16
U32
U64
U128
Unalign
A type with no alignment requirement.
Usize
A word-sized unsigned integer stored in a given byte order.
ValidityError
The error emitted if the conversion source contains invalid data.

Enums§

BigEndian
Big-endian byte order.
ConvertError
Zerocopy’s generic error type.
LittleEndian
Little-endian byte order.

Traits§

ByteOrder
A type-level representation of byte order.
ByteSlice
A mutable or immutable reference to a byte slice.
ByteSliceMut
A mutable reference to a byte slice.
CloneableByteSlice
A ByteSlice which can be cloned without violating dereference stability.
CopyableByteSlice
A ByteSlice which can be copied without violating dereference stability.
FromBytes
Types for which any bit pattern is valid.
FromZeros
Types for which a sequence of 0 bytes is a valid instance.
Immutable
Types which are free from interior mutability.
IntoByteSlice
A ByteSlice that conveys no ownership, and so can be converted into a byte slice.
IntoByteSliceMut
A ByteSliceMut that conveys no ownership, and so can be converted into a mutable byte slice.
IntoBytes
Types that can be converted to an immutable slice of initialized bytes.
KnownLayout
Indicates that zerocopy can reason about certain aspects of a type’s layout.
SplitAt
Types that can be split in two.
SplitByteSlice
A ByteSlice that can be split in two.
SplitByteSliceMut
A shorthand for SplitByteSlice and ByteSliceMut.
TryFromBytes
Types for which some bit patterns are valid.
Unaligned
Types with no alignment requirement.

Type Aliases§

AlignedTryCastError
The error type of well-aligned, fallible casts.
BE
A type alias for BigEndian.
CastError
The error type of reference conversions.
LE
A type alias for LittleEndian.
Maybe
A shorthand for a maybe-valid, maybe-aligned reference. Used as the argument to TryFromBytes::is_bit_valid.
NativeEndian
The endianness used by this platform.
NetworkEndian
The endianness used in many network protocols.
TryCastError
The error type of fallible reference conversions.
TryReadError
The error type of fallible read-conversions.

Derive Macros§

ByteEq
ByteHash
FromBytes
FromZeros
Immutable
IntoBytes
KnownLayout
SplitAt
TryFromBytes
Unaligned