#[non_exhaustive]pub struct SipTargetDialog { /* private fields */ }Expand description
A parsed Target-Dialog header value (RFC 4538 §7).
Identifies an existing dialog: Call-ID plus the mandatory local-tag
and remote-tag, both from the perspective of the request recipient.
Implementations§
Source§impl SipTargetDialog
impl SipTargetDialog
Sourcepub fn parse(raw: &str) -> Result<Self, SipTargetDialogError>
pub fn parse(raw: &str) -> Result<Self, SipTargetDialogError>
Parse a wire-form header value: callid;local-tag=x;remote-tag=y.
Sourcepub fn parse_uri_header(raw: &str) -> Result<Self, SipTargetDialogError>
pub fn parse_uri_header(raw: &str) -> Result<Self, SipTargetDialogError>
Parse the percent-encoded framing found in a URI header,
e.g. callid%40host%3Blocal-tag%3Dx%3Bremote-tag%3Dy.
Accepts the canonicalised value returned by
sip_uri::SipUri::header; Display re-encodes to
that same canonical form (uppercase hex).
Sourcepub fn with_call_id(
self,
call_id: impl Into<String>,
) -> Result<Self, SipTargetDialogError>
pub fn with_call_id( self, call_id: impl Into<String>, ) -> Result<Self, SipTargetDialogError>
Returns this value with a different Call-ID.
Framing, both tags and all generic parameters are preserved, so
Display re-emits the parsed input with only the
Call-ID changed.
Errors unless call_id is an RFC 3261 §25.1
callid = word [ "@" word ]. parse is lenient about
this token; a value that never came off the wire is not.
use sip_header::SipTargetDialog;
let t = SipTargetDialog::parse("abc@203.0.113.5;local-tag=l1;remote-tag=r1")?
.with_call_id("abc@example.com")?;
assert_eq!(t.to_string(), "abc@example.com;local-tag=l1;remote-tag=r1");Sourcepub fn remote_tag(&self) -> &str
pub fn remote_tag(&self) -> &str
The mandatory remote-tag value.
Trait Implementations§
Source§impl Clone for SipTargetDialog
impl Clone for SipTargetDialog
Source§fn clone(&self) -> SipTargetDialog
fn clone(&self) -> SipTargetDialog
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more