Skip to main content

Module event

Module event 

Source
Expand description

Trace event types.

StructsΒ§

ByteStr πŸ”’
Wrapper that serializes as a CBOR byte string (major type 2). Without this wrapper, serializing &[u8] via generic Serialize produces a CBOR array of u8.
SubscriptionRef
A (peer, request id) reference naming one subscription on one peer.
TraceEvent
A single event in a .moqtrace file.

EnumsΒ§

DerivationKind
How an upstream subscription came to serve a downstream one.
Direction
Direction of a message or stream relative to the recording endpoint.
ErrorKind
What sort of failure an Error event records.
EventData
Event-specific payload, discriminated by type.
PeerRole
Role a peer is acting in at connection time.
Side
Which end of a relay a peer sits on.
StreamType
Data stream type.

ConstantsΒ§

ERROR_RAW_CAP
The most bytes a recorder may put in an Error event’s "raw". Fixed by the format β€” SPEC.md, Event 6, under the heading about the cap and "rawlen".
EVENT_ANNOTATION πŸ”’
EVENT_CONTROL_MESSAGE πŸ”’
Event type discriminants, matching the specification’s "e" values.
EVENT_ERROR πŸ”’
EVENT_OBJECT_HEADER πŸ”’
EVENT_OBJECT_PAYLOAD πŸ”’
EVENT_PEER_CONNECTED πŸ”’
EVENT_PEER_DISCONNECTED πŸ”’
EVENT_STATE_CHANGE πŸ”’
EVENT_STREAM_CLOSED πŸ”’
EVENT_STREAM_OPENED πŸ”’
EVENT_SUBSCRIPTION_DERIVATION πŸ”’
REQUIRED_COMMON_KEYS πŸ”’
The three keys every event carries whatever its type. All are required, so a value the reader cannot use is a malformed event rather than something to keep: there would be no event left to hang the kept key on.
TAG_UINT8_ARRAY πŸ”’
Tag 64 marks a byte string as an array of unsigned 8-bit integers.
TRACE_ID_LEN
Length of a trace ID, in bytes. Fixed by the format.

FunctionsΒ§

as_bytes πŸ”’
Read a byte string, unwrapping the typed-array tag some encoders add.
detail_rank πŸ”’
Where detail sits in the levels’ ordering, or None for a level this crate cannot place.
detail_reaches πŸ”’
Whether a recorder at detail records everything a recorder at floor does.
get_bytes πŸ”’
Helper to extract byte string from a CBOR map by key.
get_int πŸ”’
Helper to extract an i64 from a CBOR map by key. See get_uint.
get_message πŸ”’
Read a control message’s decoded "msg" field.
get_namespace πŸ”’
Read a track namespace: an array of byte strings, tolerating text entries from encoders that lose the distinction.
get_text πŸ”’
Helper to extract a text string from a CBOR map by key.
get_trace_id πŸ”’
Read a trace ID, refusing any length but the one the format fixes.
get_uint πŸ”’
Helper to extract a u64 from a CBOR map by key.
get_value πŸ”’
Helper to extract a value from a CBOR map by key.
require_direction πŸ”’
require_int πŸ”’
require_text πŸ”’
require_uint πŸ”’
require_value πŸ”’
unrecognised_keys πŸ”’
Every entry on pairs that the event decoded from it does not write back out of a field of its own. See unrecognised, which the header uses for the same reason.
writes_common_key πŸ”’
Whether the common event fields account for key β€” the required three always, and "p" only when a peer was actually read from it.
writes_variant_key πŸ”’
Whether key is written from one of data’s own fields β€” equivalently, on an event that was decoded, whether the decode used it. The common keys are not this function’s business; writes_common_key answers for those.