#[non_exhaustive]pub struct SrtUrl {
pub host: String,
pub port: u16,
pub stream_id: Option<String>,
pub latency_ms: Option<u16>,
pub mode: SrtMode,
pub passphrase: Option<String>,
}std only.Expand description
A parsed srt:// URL: the endpoint to dial and its Stream ID overrides.
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.host: StringThe endpoint’s host (a domain name or a bracketed IP literal).
port: u16The endpoint’s port, DEFAULT_PORT when the URL omits it.
stream_id: Option<String>The opaque streamid value, percent-decoded.
latency_ms: Option<u16>The latency value in milliseconds, at most MAX_LATENCY_MS.
mode: SrtModeThe mode value; SrtMode::Caller when absent.
passphrase: Option<String>The passphrase value (payload encryption).
Implementations§
Source§impl SrtUrl
impl SrtUrl
Sourcepub fn parse(url: &str) -> Result<Self, UrlRejection>
pub fn parse(url: &str) -> Result<Self, UrlRejection>
Parse an srt:// URL; see this module’s own doc for the accepted
shapes.
An absent latency, mode or passphrase leaves the corresponding
field unset, so the caller keeps whatever its handshake config already
holds. Unknown query keys are ignored.
§Errors
UrlRejection::Authority for a bad authority,
UrlRejection::LatencyNotANumber/UrlRejection::LatencyTooLarge
for a latency, and UrlRejection::Mode for an unknown mode.