#[non_exhaustive]pub struct SrtUrl {
pub host: String,
pub port: u16,
pub stream_id: Option<String>,
pub latency: Option<Duration>,
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: Option<Duration>The latency value, 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.
Sourcepub fn parse_endpoint(addr: &str) -> Result<Self, UrlRejection>
pub fn parse_endpoint(addr: &str) -> Result<Self, UrlRejection>
Parse a bare host:port endpoint: the authority an operator configures
for a caller-mode dial. Unlike SrtUrl::parse the port is required
and nothing may follow the authority, so a path, query, fragment or
userinfo is rejected rather than dropped.
§Errors
UrlRejection::Authority when addr is not exactly host:port
(a bracketed IPv6 literal is accepted, a bare one is not).