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<SipCallInfo, SipCallInfoError>
pub fn parse(raw: &str) -> Result<SipCallInfo, 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<SipCallInfo, SipCallInfoError>
pub fn from_entries<'a>( entries: impl IntoIterator<Item = &'a str>, ) -> Result<SipCallInfo, 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§type Item = &'a SipCallInfoEntry
type Item = &'a SipCallInfoEntry
The type of the elements being iterated over.
Source§type IntoIter = Iter<'a, SipCallInfoEntry>
type IntoIter = Iter<'a, SipCallInfoEntry>
Which kind of iterator are we turning this into?
Source§fn into_iter(self) -> <&'a SipCallInfo as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a SipCallInfo as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
Source§impl IntoIterator for SipCallInfo
impl IntoIterator for SipCallInfo
Source§type Item = SipCallInfoEntry
type Item = SipCallInfoEntry
The type of the elements being iterated over.
Source§type IntoIter = IntoIter<SipCallInfoEntry>
type IntoIter = IntoIter<SipCallInfoEntry>
Which kind of iterator are we turning this into?
Source§fn into_iter(self) -> <SipCallInfo as IntoIterator>::IntoIter
fn into_iter(self) -> <SipCallInfo as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.