Crate ingot_types

Source
Expand description

Primitive types and core traits needed to generate and use ingot packets.

Re-exports§

pub use field::*;
pub use header::*;
pub use ip::*;

Modules§

field
Header equivalents for header fields accessed by reference.
header
An abstraction layer over in-buffer and owned packets and headers.
ip
Minimal types for IPv4 and IPv6 addresses
primitives
Primitive types – integers of known endianness, and base buffer types.
util
Utilities for parsing more complex packet types or specific inputs.

Macros§

zerocopy_impls
Macro which defines HeaderLen and Emit for a zerocopy-type
zerocopy_type
Macro which declares a zerocopy-flavored type, which can be used in a field

Structs§

Accessor
A tool for converting zerocopy’s Ref<_, T>s into &T/&mut T based on need and input B mutability.
CRStr
A static string which is jointly usable as a CStr and str.
CRStrError
Error encountered while constructing a CRStr (the string was not null-terminated, or was invalid UTF-8).
PacketParseError
An error encountered while parsing a complete packet.
Parsed
Successful return value from parsing a full packet header stack over a base packet buffer which is Read.
Vec
A contiguous growable array type, written as Vec<T>, short for ‘vector’.

Enums§

ParseControl
Action to be taken as part of an #[ingot(control)] block during packet parsing.
ParseError
An error encountered while parsing an individual header.

Traits§

ByteSlice
A mutable or immutable reference to a byte slice.
ByteSliceMut
A mutable reference to a byte slice.
Emit
Serialise a network packet/header into a byte buffer.
EmitDoesNotRelyOnBufContents
A promise from the programmer to the compiler that an implementation of Emit does not perform any reads from uninitialised memory.
HasRepr
A type which has a corresponding static/owned representation type.
HasView
A type which has a corresponding view-type over any buffer B.
HeaderLen
Base trait for header/packet types.
HeaderParse
A header/packet type which can be unconditionally parsed from any buffer B.
IntoBufPointer
Convert a byte slice into a pointer to its base.
IntoByteSlice
A ByteSlice that conveys no ownership, and so can be converted into a byte slice.
NetworkRepr
Types which can be converted to and from bitstrings and byte arrays for serialisation as fields of network packets.
NextLayer
Headers which can be queried for a hint, used to select the next layer in a packet.
Read
An iterator over contiguous byte slices which can be parsed as a packet.
SplitByteSlice
A ByteSlice that can be split in two.
SplitByteSliceMut
A shorthand for SplitByteSlice and ByteSliceMut.
ToOwnedPacket
Converts a borrowed view of a header into an owned version, possibly reparsing to do so.

Type Aliases§

PacketParseResult
Convenience type for fallible operations done while parsing full packets.
ParseResult
Convenience type for fallible operations done while parsing headers.
Success
Helper alias for methods which return tuples of (header, next_layer_hint, buf_remainder).