#[non_exhaustive]pub struct PublishTarget {
pub app: String,
pub stream_key: String,
}target only.Expand description
The app and stream key an RTMP publish URL names: the inverse of
crate::target::RtmpTarget::tc_url.
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.app: StringThe RTMP app name.
stream_key: StringThe publishing name (stream key); empty when the URL states none.
Implementations§
Source§impl PublishTarget
impl PublishTarget
Sourcepub fn parse(url: &str) -> Self
pub fn parse(url: &str) -> Self
Split an rtmp://host[:port]/app/stream-key URL into its app and
stream key, with an RTMP server’s own convention: everything before
the last path segment is the app (a multi-segment app such as
app/instance keeps its slashes) and the last segment is the stream
key.
A URL with no path at all falls back to app = "live" and an empty
key (a push route configured without one), and one segment names
only the app. A URL that does not parse is that same fallback rather
than an error: a push route’s configuration, not its URL, decides
the app and key it publishes to.
Trait Implementations§
Source§impl Clone for PublishTarget
impl Clone for PublishTarget
Source§impl Debug for PublishTarget
Manual Debug: the stream key is the publish secret and never renders
(issue #1142).
impl Debug for PublishTarget
Manual Debug: the stream key is the publish secret and never renders
(issue #1142).