Expand description
Leverage common functionality across multiple primitives.
Re-exports§
pub use sequence::Array;pub use sequence::Span;pub use acknowledgement::Acknowledgement;pub use hostname::Hostname;pub use net::IpAddrExt;pub use time::DurationExt;pub use time::SystemTimeExt;pub use rational::BigRationalExt;
Modules§
- acknowledgement
- Utilities for providing acknowledgement.
- bitmap
- Bitmap implementation
- channels
- Utilities for working with channels.
- concurrency
- Utilities for managing concurrency.
- futures
- Utilities for working with futures.
- hex_
literal - Hex literal macro implementation.
- hostname
- Validated hostname type conforming to RFC 1035/1123.
- net
- Utilities for working with IP addresses.
- ordered
- Ordered collections that guarantee sorted, deduplicated items.
- rational
- Utilities for working with
num_rational::BigRational. - sequence
- time
- Utility functions for
std::time. - vec
- A vector type that guarantees at least one element.
Macros§
- NZDuration
- A macro to create a
NonZeroDurationfrom a duration, panicking if the duration is zero. - NZU8
- A macro to create a
NonZeroU8from a value, panicking if the value is zero. For literal values, validation occurs at compile time. For expressions, validation occurs at runtime. - NZU16
- A macro to create a
NonZeroU16from a value, panicking if the value is zero. For literal values, validation occurs at compile time. For expressions, validation occurs at runtime. - NZU32
- A macro to create a
NonZeroU32from a value, panicking if the value is zero. For literal values, validation occurs at compile time. For expressions, validation occurs at runtime. - NZU64
- A macro to create a
NonZeroU64from a value, panicking if the value is zero. For literal values, validation occurs at compile time. For expressions, validation occurs at runtime. - NZUsize
- A macro to create a
NonZeroUsizefrom a value, panicking if the value is zero. For literal values, validation occurs at compile time. For expressions, validation occurs at runtime. - fixed_
bytes - Macro for converting sequence of string literals containing hex-encoded data into a FixedBytes type.
- hex
- Macro for converting sequence of string literals containing hex-encoded data into an array of bytes.
- hostname
- Creates a
Hostnamefrom a string literal or expression. - non_
empty_ vec - Creates a
NonEmptyVeccontaining the given elements.
Structs§
- NonZero
Duration - A wrapper around
Durationthat guarantees the duration is non-zero. - Priority
Set - A set that offers efficient iteration over its elements in priority-ascending order.
Enums§
- Stable
Buf - A buffer whose memory is stable as long as its not reallocated.
Traits§
- TryCollect
- Extension trait for iterators that provides fallible collection.
- TryFrom
Iterator - A type that can be constructed from an iterator, possibly failing.
Functions§
- from_
hex - Converts a hexadecimal string to bytes.
- from_
hex_ formatted - Converts a hexadecimal string to bytes, stripping whitespace and/or a
0xprefix. Commonly used in testing to encode external test vectors without modification. - hex
- Converts bytes to a hexadecimal string.
- max_
faults - Compute the maximum number of
f(faults) that can be tolerated for a given set ofnparticipants. This is the maximum integerfsuch thatn >= 3*f + 1.fmay be zero. - modulo
- Compute the modulo of bytes interpreted as a big-endian integer.
- quorum
- Compute the quorum size for a given set of
nparticipants. This is the minimum integerqsuch that3*q >= 2*n + 1. It is also equal ton - f, wherefis the maximum number of faults. - quorum_
from_ slice - Compute the quorum size for a given slice.
- union
- Computes the union of two byte slices.
- union_
unique - Concatenate a namespace and a message, prepended by a varint encoding of the namespace length.
Type Aliases§
- Boxed
Error - Alias for boxed errors that are
SendandSync.