#[non_exhaustive]pub enum ServerEvent {
Connected {
app: String,
},
Publish {
app: String,
stream_key: String,
stream_id: u32,
},
Media {
flv: Vec<u8>,
},
Eof,
Unsupported {
message_type_id: MessageTypeId,
},
Damage(Box<Damage>),
}Expand description
Typed events ServerSession::handle_data surfaces to the caller.
Serde-serializable only: a ServerEvent::Damage carries a
broadcast_core::damage::Damage, whose typed cause wraps the workspace’s
shared error kinds and is therefore write-only, so the enum cannot be
reconstructed from JSON.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Connected
connect completed: the publisher’s requested app name (§7.2.1).
Publish
publish was accepted (stream key matched, or no key was
configured): the session is now Publishing.
Fields
Media
One FLV tag run is ready: the payload of a single Audio(8)/Video(9)/
Data-AMF0(18) message, converted to an FLV tag (+ PreviousTagSize).
The very first Media event of a session is prefixed with the FLV
file header, so concatenating every Media.flv in arrival order
yields a valid FLV byte stream feedable to transmux::FlvDemux.
Fields
Eof
The publisher ended the stream (deleteStream/FCUnpublish).
Unsupported
A message type this engine doesn’t decode was received and its payload was dropped (#1108/RTMP-W6) — Data-AMF3(15), Command-AMF3(17, now decoded as AMF0 after its format byte), or Shared Object(16/19). Pre-fix, these were silently ignored with no signal at all. Aggregate(22) no longer surfaces here: it is unpacked into its contained sub-messages (#1108 remainder), and a malformed aggregate is an error instead.
Fields
message_type_id: MessageTypeIdThe message type id that was dropped (§6/§7.1).
Damage(Box<Damage>)
Content this session skipped or repaired — the one
broadcast_core::damage::Damage report, in wire order with the
events around it. ServerEvent::Unsupported names the message type
of the same drop; this carries the severity and is what the caller’s
RtmpServerConfig::damage_policy decides on.
Boxed because an unboxed report would enlarge every event and every
Result in the crate.
Trait Implementations§
Source§impl Clone for ServerEvent
impl Clone for ServerEvent
Source§impl Debug for ServerEvent
Manual Debug: Publish carries the publisher’s stream key (the ingest
secret) and Media carries whole FLV tag runs; neither renders verbatim
(issue #1142).
impl Debug for ServerEvent
Manual Debug: Publish carries the publisher’s stream key (the ingest
secret) and Media carries whole FLV tag runs; neither renders verbatim
(issue #1142).
Source§impl PartialEq for ServerEvent
impl PartialEq for ServerEvent
Source§impl Serialize for ServerEvent
Available on crate feature serde only.
impl Serialize for ServerEvent
serde only.