ServerEvent

Enum ServerEvent 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

ClientLinked

A new client has linked to a module.

Fields

§peer: SocketAddr

Client peer address.

§callsign: Callsign

Client callsign.

§module: Module

Module the client linked to.

§

ClientUnlinked

A client has unlinked.

Fields

§peer: SocketAddr

Client peer address.

§

ClientStreamStarted

A client started a voice stream.

Fields

§peer: SocketAddr

Client peer.

§stream_id: StreamId

Stream id.

§header: DStarHeader

The header they sent.

§

ClientStreamFrame

A client sent a voice frame.

Fields

§peer: SocketAddr

Client peer.

§stream_id: StreamId

Stream id.

§seq: u8

Frame seq.

§frame: VoiceFrame

Voice frame.

§

ClientStreamEnded

A client ended a voice stream.

Fields

§peer: SocketAddr

Client peer.

§stream_id: StreamId

Stream id.

§

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: SocketAddr

Client peer that was rejected.

§reason: ClientRejectedReason

Why 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: SocketAddr

Client peer that attempted to transmit.

§stream_id: StreamId

Stream id of the dropped frame.

§

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: SocketAddr

Client peer that was evicted.

§reason: String

Human-readable reason for eviction.

Trait Implementations§

Source§

impl<P: Clone + Protocol> Clone for ServerEvent<P>

Source§

fn clone(&self) -> ServerEvent<P>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<P: Debug + Protocol> Debug for ServerEvent<P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<P> Freeze for ServerEvent<P>

§

impl<P> RefUnwindSafe for ServerEvent<P>
where P: RefUnwindSafe,

§

impl<P> Send for ServerEvent<P>

§

impl<P> Sync for ServerEvent<P>

§

impl<P> Unpin for ServerEvent<P>
where P: Unpin,

§

impl<P> UnwindSafe for ServerEvent<P>
where P: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more