#[non_exhaustive]pub enum ServerEvent<P: Protocol> {
ClientLinked {
peer: SocketAddr,
callsign: Callsign,
module: Module,
},
ClientUnlinked {
peer: SocketAddr,
},
ClientStreamStarted {
peer: SocketAddr,
stream_id: StreamId,
header: DStarHeader,
},
ClientStreamFrame {
peer: SocketAddr,
stream_id: StreamId,
seq: u8,
frame: VoiceFrame,
},
ClientStreamEnded {
peer: SocketAddr,
stream_id: StreamId,
},
ClientRejected {
peer: SocketAddr,
reason: ClientRejectedReason,
},
VoiceFromReadOnlyDropped {
peer: SocketAddr,
stream_id: StreamId,
},
ClientEvicted {
peer: SocketAddr,
reason: String,
},
}Expand description
One event surfaced by the server-side session machine.
The P: Protocol parameter is a phantom — every variant carries
the same data regardless of protocol. The phantom is for
compile-time discrimination only, confined to a hidden
ServerEvent::__Phantom variant that cannot be constructed
(its payload is an uninhabited Infallible).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ClientLinked
A new client has linked to a module.
Fields
peer: SocketAddrClient peer address.
ClientUnlinked
A client has unlinked.
Fields
peer: SocketAddrClient peer address.
ClientStreamStarted
A client started a voice stream.
ClientStreamFrame
A client sent a voice frame.
ClientStreamEnded
A client ended a voice stream.
ClientRejected
A link attempt was refused by the shell authorizer.
Emitted before any handle is created — the rejected client is not present in the pool. The reflector additionally enqueues a protocol-appropriate NAK to the peer.
Fields
peer: SocketAddrClient peer that was rejected.
reason: ClientRejectedReasonWhy the authorizer refused the link.
VoiceFromReadOnlyDropped
Voice from a read-only client was dropped.
Emitted when a client whose AccessPolicy is ReadOnly
sends a voice header / data / EOT packet. The reflector drops
the frame silently on the wire so the originator isn’t told
the difference — this event lets consumers observe the drop
for metrics and audit purposes without exposing it on-air.
Fields
peer: SocketAddrClient peer that attempted to transmit.
ClientEvicted
A client was evicted by the reflector.
Emitted when the shell removes a client for reasons unrelated to a protocol-level UNLINK — e.g. the send-failure threshold was exceeded or a health check fired. The peer entry has already been removed from the pool by the time this event is observed.
Fields
peer: SocketAddrClient peer that was evicted.
Trait Implementations§
Source§impl<P: Clone + Protocol> Clone for ServerEvent<P>
impl<P: Clone + Protocol> Clone for ServerEvent<P>
Source§fn clone(&self) -> ServerEvent<P>
fn clone(&self) -> ServerEvent<P>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more