LoggingHandler

Struct LoggingHandler 

Source
pub struct LoggingHandler;
Expand description

A simple handler that accepts all connections and logs events

Trait Implementations§

Source§

impl RtmpHandler for LoggingHandler

Source§

async fn on_connection(&self, ctx: &SessionContext) -> bool

Called when a new TCP connection is established Read more
Source§

async fn on_connect( &self, ctx: &SessionContext, params: &ConnectParams, ) -> AuthResult

Called on RTMP ‘connect’ command Read more
Source§

async fn on_publish( &self, ctx: &SessionContext, params: &PublishParams, ) -> AuthResult

Called on ‘publish’ command Read more
Source§

async fn on_metadata( &self, ctx: &StreamContext, metadata: &HashMap<String, AmfValue>, )

Called when stream metadata is received (@setDataFrame/onMetaData)
Source§

async fn on_disconnect(&self, ctx: &SessionContext)

Called when the connection closes
Source§

fn on_handshake_complete( &self, _ctx: &SessionContext, ) -> impl Future<Output = ()> + Send

Called after successful handshake, before connect command
Source§

fn on_fc_publish( &self, _ctx: &SessionContext, _stream_key: &str, ) -> impl Future<Output = AuthResult> + Send

Called on FCPublish command (OBS/Twitch compatibility) Read more
Source§

fn on_play( &self, _ctx: &SessionContext, _params: &PlayParams, ) -> impl Future<Output = AuthResult> + Send

Called on ‘play’ command Read more
Source§

fn on_media_tag( &self, _ctx: &StreamContext, _tag: &FlvTag, ) -> impl Future<Output = bool> + Send

Called for each raw FLV tag (when MediaDeliveryMode includes RawFlv) Read more
Source§

fn on_video_frame( &self, _ctx: &StreamContext, _frame: &H264Data, _timestamp: u32, ) -> impl Future<Output = ()> + Send

Called for each video frame (when MediaDeliveryMode includes ParsedFrames)
Source§

fn on_audio_frame( &self, _ctx: &StreamContext, _frame: &AacData, _timestamp: u32, ) -> impl Future<Output = ()> + Send

Called for each audio frame (when MediaDeliveryMode includes ParsedFrames)
Source§

fn on_keyframe( &self, _ctx: &StreamContext, _timestamp: u32, ) -> impl Future<Output = ()> + Send

Called when a keyframe is received
Source§

fn on_publish_stop( &self, _ctx: &StreamContext, ) -> impl Future<Output = ()> + Send

👎Deprecated since 0.3.0: Use on_unpublish instead
Called when the publish stream ends
Source§

fn on_unpublish(&self, _ctx: &StreamContext) -> impl Future<Output = ()> + Send

Called when the publish stream ends
Source§

fn on_play_stop(&self, _ctx: &StreamContext) -> impl Future<Output = ()> + Send

Called when the play stream ends
Source§

fn on_pause(&self, _ctx: &StreamContext) -> impl Future<Output = ()> + Send

Called when a subscriber pauses playback
Source§

fn on_unpause(&self, _ctx: &StreamContext) -> impl Future<Output = ()> + Send

Called when a subscriber resumes playback
Source§

fn media_delivery_mode(&self) -> MediaDeliveryMode

Get the media delivery mode for this handler
Source§

fn on_stats_update( &self, _ctx: &SessionContext, ) -> impl Future<Output = ()> + Send

Called periodically with stats update

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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, 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.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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