#[non_exhaustive]pub struct RtmpServerConfig {
pub chunk_size: u32,
pub window_ack_size: u32,
pub peer_bandwidth: u32,
pub expected_stream_key: Option<String>,
pub limits: ServerLimits,
pub damage_policy: DamagePolicy,
}Expand description
Configuration for a ServerSession.
#[non_exhaustive]: fields may grow (e.g. a future app gate alongside
expected_stream_key). Construct via RtmpServerConfig::new plus the
with_* builder methods rather than a struct literal.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.chunk_size: u32Outbound chunk size advertised (and adopted) on connect (§5.4.1).
window_ack_size: u32Window Acknowledgement Size advertised on connect (§5.4.4); also
the initial threshold for this session’s own inbound Ack accounting
(§5.4.3), until a peer WindowAckSize/SetPeerBandwidth updates it.
peer_bandwidth: u32Set Peer Bandwidth value advertised on connect (§5.4.5).
expected_stream_key: Option<String>If set, publish’s stream key (publishing name) must match this
value exactly or the publish is rejected: onStatus
NetStream.Publish.BadName, and no Publish/Media events are
emitted for that connection.
None (the default) admits any publisher. A listener reachable
from an untrusted network must set a key (or authenticate the
publisher some other way before handing bytes to this session).
limits: ServerLimitsThe bounds this session holds its peer to.
damage_policy: DamagePolicyWhat each ServerEvent::Damage report means: Report (the default
for everything) publishes it and keeps reading; Fail ends the
session with RtmpError::Damage carrying the same report.
Implementations§
Source§impl RtmpServerConfig
impl RtmpServerConfig
Sourcepub fn for_profile(profile: Profile) -> Self
pub fn for_profile(profile: Profile) -> Self
The Profile preset: an ingest admitting any publisher under
ServerLimits::for_profile, replaceable through its with_* setters
and public fields.
Source§impl RtmpServerConfig
impl RtmpServerConfig
Sourcepub fn new(
limits: ServerLimits,
chunk_size: u32,
window_ack_size: u32,
peer_bandwidth: u32,
) -> Self
pub fn new( limits: ServerLimits, chunk_size: u32, window_ack_size: u32, peer_bandwidth: u32, ) -> Self
A configuration advertising chunk_size, window_ack_size and peer_bandwidth on
connect, admitting any publisher and holding its peer to limits.
Sourcepub fn with_expected_stream_key(
self,
expected_stream_key: Option<String>,
) -> Self
pub fn with_expected_stream_key( self, expected_stream_key: Option<String>, ) -> Self
Set RtmpServerConfig::expected_stream_key. #[non_exhaustive] forbids
struct-literal construction of this type from outside the crate, so
this (plus the other with_* builders below) is how a caller
customises a field starting from RtmpServerConfig::new.
Sourcepub fn with_chunk_size(self, chunk_size: u32) -> Self
pub fn with_chunk_size(self, chunk_size: u32) -> Self
Sourcepub fn with_limits(self, limits: ServerLimits) -> Self
pub fn with_limits(self, limits: ServerLimits) -> Self
Sourcepub fn with_damage_policy(self, damage_policy: DamagePolicy) -> Self
pub fn with_damage_policy(self, damage_policy: DamagePolicy) -> Self
Trait Implementations§
Source§impl Clone for RtmpServerConfig
impl Clone for RtmpServerConfig
Source§impl Debug for RtmpServerConfig
Manual Debug: the expected stream key is the ingest secret and never
renders (issue #1142).
impl Debug for RtmpServerConfig
Manual Debug: the expected stream key is the ingest secret and never
renders (issue #1142).