pub struct SipCallInfo(/* private fields */);Expand description
Parsed SIP Call-Info header value. Contains zero or more entries.
Accepts both standard comma-separated SIP format and FreeSWITCH
ARRAY::|: encoding.
use freeswitch_types::variables::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 raw Call-Info header value. Handles both standard
comma-separated SIP format and FreeSWITCH 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.
Sourcepub fn find_by_purpose_suffix(&self, suffix: &str) -> Option<&SipCallInfoEntry>
pub fn find_by_purpose_suffix(&self, suffix: &str) -> Option<&SipCallInfoEntry>
Find the first entry whose purpose parameter ends with the given
suffix (case-insensitive).
Sourcepub fn filter_by_purpose_suffix<'a>(
&'a self,
suffix: &'a str,
) -> impl Iterator<Item = &'a SipCallInfoEntry>
pub fn filter_by_purpose_suffix<'a>( &'a self, suffix: &'a str, ) -> impl Iterator<Item = &'a SipCallInfoEntry>
Iterate over entries whose purpose parameter ends with the given
suffix (case-insensitive).
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
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.