pub struct SipCallInfo(/* private fields */);Expand description
Parsed SIP Call-Info header value. Contains zero or more entries.
use sip_header::SipCallInfo;
let raw = "<urn:example:call:123>;purpose=emergency-CallId,<https://example.com/data>;purpose=EmergencyCallData.ServiceInfo";
let info = SipCallInfo::parse(raw).unwrap();
assert_eq!(info.entries().len(), 2);
assert_eq!(info.entries()[0].purpose(), Some("emergency-CallId"));Implementations§
Source§impl SipCallInfo
impl SipCallInfo
Sourcepub fn parse(raw: &str) -> Result<Self, SipCallInfoError>
pub fn parse(raw: &str) -> Result<Self, SipCallInfoError>
Parse a standard comma-separated Call-Info header value (RFC 3261 §20.9).
Sourcepub fn from_entries<'a>(
entries: impl IntoIterator<Item = &'a str>,
) -> Result<Self, SipCallInfoError>
pub fn from_entries<'a>( entries: impl IntoIterator<Item = &'a str>, ) -> Result<Self, SipCallInfoError>
Build from pre-split header entries.
Each entry should be a single <uri>;param=value string. Use this
when entries have already been split by an external mechanism (e.g.
a transport-specific array encoding).
Sourcepub fn entries(&self) -> &[SipCallInfoEntry]
pub fn entries(&self) -> &[SipCallInfoEntry]
The parsed entries as a slice.
Sourcepub fn into_entries(self) -> Vec<SipCallInfoEntry>
pub fn into_entries(self) -> Vec<SipCallInfoEntry>
Consume self and return the entries as a Vec.
Trait Implementations§
Source§impl Clone for SipCallInfo
impl Clone for SipCallInfo
Source§fn clone(&self) -> SipCallInfo
fn clone(&self) -> SipCallInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SipCallInfo
impl Debug for SipCallInfo
Source§impl Display for SipCallInfo
impl Display for SipCallInfo
Source§impl<'a> IntoIterator for &'a SipCallInfo
impl<'a> IntoIterator for &'a SipCallInfo
Source§impl IntoIterator for SipCallInfo
impl IntoIterator for SipCallInfo
Source§impl PartialEq for SipCallInfo
impl PartialEq for SipCallInfo
impl Eq for SipCallInfo
impl StructuralPartialEq for SipCallInfo
Auto Trait Implementations§
impl Freeze for SipCallInfo
impl RefUnwindSafe for SipCallInfo
impl Send for SipCallInfo
impl Sync for SipCallInfo
impl Unpin for SipCallInfo
impl UnsafeUnpin for SipCallInfo
impl UnwindSafe for SipCallInfo
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