Module misc

Source
Expand description

misc functions & tools - less stable

Re-exports§

pub use misc_utils as utils;

Structs§

MutXHeaderPoint
Wrapper around a point with a mutable XHeader Useful when wrapping an Arc point, such that you can mutate the xheader before using serialize.
PointCmp
A newtype around any T:Point that implements Eq (and Hash) based on point hash and Ord on the standard tree index order.
RecvPoint
Wrapper around a Point that sets its recv field
SharePointArc
Wrapper around a Point that ensures .as_netarc() is only called once.
SpaceDBEntry
A wrapper around SpaceKey ( see [[TreeKey::from_fields]] ) and [[TreeValue]] This is the key/value by which packets are saved in the tree index. Ord of ( group, domain, n_parts, path, pubkey, create stamp, hash )

Enums§

FieldEnum
An enum that provides access to the fields in a Point

Statics§

DEFAULT_ROUTING_BITS
A thread local default net header value when creating new netpackets
MARK_SVG
START_STAMP

Functions§

blake3
Blake3 hash
bytes2uniform
Read bytes as a [0,1) float by reading the first 52 bits. Panics if fewer than 8 bytes are supplied Can be used to produces a shared ‘random’ value by using Point::hash or blake3 as input.
calc_free_space
Calculate the free space left in bytes. Negative values means it will not fit.
read_point_len