#[non_exhaustive]pub struct RtmpTarget {
pub host: Host<String>,
pub port: u16,
pub app: String,
pub stream_key: String,
pub tc_url: String,
}Available on crate feature
tokio only.Expand description
A parsed RTMP publish target.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.host: Host<String>Host, never a pre-formatted string. rtmp is a non-special URL scheme, so
the url crate reports an IPv4 literal as Host::Domain("127.0.0.1")
(resolve handles it, lookup_host accepts literals); only a bracketed IPv6
literal becomes Host::Ipv6.
port: u16TCP port; 1935 when the URL has none.
app: StringThe RTMP app.
stream_key: StringRemaining path plus ?query, raw (not percent-decoded).
tc_url: Stringrtmp://host[:port]/app, IPv6 bracketed, userinfo/query/fragment removed.
Implementations§
Source§impl RtmpTarget
impl RtmpTarget
Sourcepub fn parse(url: &str) -> Result<Self, RtmpUrlError>
pub fn parse(url: &str) -> Result<Self, RtmpUrlError>
Parses rtmp://host[:port]/app/stream-key[?query].
Sourcepub fn from_parts(
base: &str,
app: &str,
stream_key: &str,
) -> Result<Self, RtmpUrlError>
pub fn from_parts( base: &str, app: &str, stream_key: &str, ) -> Result<Self, RtmpUrlError>
Host and port from base (any path/query is ignored), app and
stream_key given separately.
Sourcepub async fn resolve(&self) -> Result<Vec<SocketAddr>>
pub async fn resolve(&self) -> Result<Vec<SocketAddr>>
Resolved socket addresses (DNS only for Host::Domain).
Trait Implementations§
Source§impl Clone for RtmpTarget
impl Clone for RtmpTarget
Source§impl Debug for RtmpTarget
Manual Debug: the stream key (path remainder plus query) is the publish
secret and never renders (issue #1142).
impl Debug for RtmpTarget
Manual Debug: the stream key (path remainder plus query) is the publish
secret and never renders (issue #1142).
impl Eq for RtmpTarget
Source§impl PartialEq for RtmpTarget
impl PartialEq for RtmpTarget
impl StructuralPartialEq for RtmpTarget
Auto Trait Implementations§
impl Freeze for RtmpTarget
impl RefUnwindSafe for RtmpTarget
impl Send for RtmpTarget
impl Sync for RtmpTarget
impl Unpin for RtmpTarget
impl UnsafeUnpin for RtmpTarget
impl UnwindSafe for RtmpTarget
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more