pub struct Interest(/* private fields */);Expand description
What machinery a hook wants armed.
Bitflags-style with no dependency. Read once per session, when the
session starts, and cached; a hook that returns a different value later
is not re-consulted. The byte-pump path is chosen structurally — which
function pipe_data calls — so re-reading per frame would require the
framer to be armed at all times in order to be able to become
interested, which is precisely the cost Interest::NONE exists to
avoid. Declare the union of everything the hook may ever want here, and
gate at runtime by returning Action::Pass.
Implementations§
Source§impl Interest
impl Interest
Sourcepub const NONE: Self
pub const NONE: Self
Pure byte pump: no parsing on any path. Today’s fast path, bit-for-bit. The default.
Sourcepub const CONTROL: Self
pub const CONTROL: Self
Parse control messages and honour actions on them. Routes the control stream through the slower parse-then-forward pipe, which costs per-frame latency.
Sourcepub const OBJECTS: Self
pub const OBJECTS: Self
Frame subgroup and fetch objects and honour actions on them. Costs whole-object buffering: an object is not forwarded until it is buffered whole, or until the framer gives up on it.
Sourcepub const DATAGRAMS: Self
pub const DATAGRAMS: Self
Decode and gate datagrams. The hook fires even when the datagram’s header does not decode.
Sourcepub const STREAMS: Self
pub const STREAMS: Self
Decide on unidirectional stream open, stream header, and stream end.
Includes Self::OBJECTS, structurally — the bit pattern is
(1 << 3) | (1 << 1), so STREAMS.contains(OBJECTS) is true by
construction rather than by documentation. The header decision only
exists once the stream is framed, and framing is what OBJECTS
turns on; a STREAMS-only hook that did not imply it would take
pipe_data_passthrough and never see a header at all.
A hook that wants stream decisions but no object decisions still
declares STREAMS and simply returns Action::Pass from
ProxyHook::on_object — it
pays for framing either way, because there is no header without it.
use moqtap_proxy::action::Interest;
assert!(Interest::STREAMS.contains(Interest::OBJECTS));