Expand description
Leverage common functionality across multiple primitives.
Re-exports§
pub use sequence::Array;pub use sequence::Span;pub use net::IpAddrExt;pub use time::DurationExt;pub use time::SystemTimeExt;pub use rational::BigRationalExt;
Modules§
- 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.
- net
- Utilities for working with IP addresses.
- rational
- Utilities for working with
num_rational::BigRational. - sequence
- set
- Ordered collections that guarantee sorted, deduplicated keys.
- time
- Utility functions for
std::time.
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. - NZU16
- A macro to create a
NonZeroU16from a value, panicking if the value is zero. - NZU32
- A macro to create a
NonZeroU32from a value, panicking if the value is zero. - NZU64
- A macro to create a
NonZeroU64from a value, panicking if the value is zero. - NZUsize
- A macro to create a
NonZeroUsizefrom a value, panicking if the value is zero. - 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.
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.
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.