pub struct HistoryInfo(/* private fields */);Expand description
Parsed History-Info header value (RFC 7044).
Contains one or more routing-chain entries, each with a SIP URI, optional index, and optional embedded Reason header.
Accepts standard comma-separated SIP format, FreeSWITCH ARRAY::|:
encoding, and bracket-wrapped format from FreeSWITCH logs.
use freeswitch_types::variables::HistoryInfo;
let raw = "<sip:alice@esrp.example.com>;index=1,<sip:sos@psap.example.com>;index=1.1";
let hi = HistoryInfo::parse(raw).unwrap();
assert_eq!(hi.len(), 2);
assert_eq!(hi.entries()[0].index(), Some("1"));
assert_eq!(hi.entries()[1].index(), Some("1.1"));Implementations§
Source§impl HistoryInfo
impl HistoryInfo
Sourcepub fn parse(raw: &str) -> Result<Self, HistoryInfoError>
pub fn parse(raw: &str) -> Result<Self, HistoryInfoError>
Parse a raw History-Info header value.
Handles comma-separated SIP format, FreeSWITCH ARRAY::|: encoding,
and bracket-wrapped values from FreeSWITCH logs.
Sourcepub fn entries(&self) -> &[HistoryInfoEntry]
pub fn entries(&self) -> &[HistoryInfoEntry]
The parsed entries as a slice.
Sourcepub fn into_entries(self) -> Vec<HistoryInfoEntry>
pub fn into_entries(self) -> Vec<HistoryInfoEntry>
Consume self and return the entries as a Vec.
Trait Implementations§
Source§impl Clone for HistoryInfo
impl Clone for HistoryInfo
Source§fn clone(&self) -> HistoryInfo
fn clone(&self) -> HistoryInfo
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 HistoryInfo
impl Debug for HistoryInfo
Source§impl Display for HistoryInfo
impl Display for HistoryInfo
Source§impl<'a> IntoIterator for &'a HistoryInfo
impl<'a> IntoIterator for &'a HistoryInfo
Source§impl IntoIterator for HistoryInfo
impl IntoIterator for HistoryInfo
Source§impl PartialEq for HistoryInfo
impl PartialEq for HistoryInfo
impl Eq for HistoryInfo
impl StructuralPartialEq for HistoryInfo
Auto Trait Implementations§
impl Freeze for HistoryInfo
impl RefUnwindSafe for HistoryInfo
impl Send for HistoryInfo
impl Sync for HistoryInfo
impl Unpin for HistoryInfo
impl UnsafeUnpin for HistoryInfo
impl UnwindSafe for HistoryInfo
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.