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.
use sip_header::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<HistoryInfo, HistoryInfoError>
pub fn parse(raw: &str) -> Result<HistoryInfo, HistoryInfoError>
Parse a standard comma-separated History-Info header value (RFC 7044).
Sourcepub fn from_entries<'a>(
entries: impl IntoIterator<Item = &'a str>,
) -> Result<HistoryInfo, HistoryInfoError>
pub fn from_entries<'a>( entries: impl IntoIterator<Item = &'a str>, ) -> Result<HistoryInfo, HistoryInfoError>
Build from pre-split header entries.
Each entry should be a single <uri>;params string. Use this
when entries have already been split by an external mechanism.
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§type Item = &'a HistoryInfoEntry
type Item = &'a HistoryInfoEntry
The type of the elements being iterated over.
Source§type IntoIter = Iter<'a, HistoryInfoEntry>
type IntoIter = Iter<'a, HistoryInfoEntry>
Which kind of iterator are we turning this into?
Source§fn into_iter(self) -> <&'a HistoryInfo as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a HistoryInfo as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
Source§impl IntoIterator for HistoryInfo
impl IntoIterator for HistoryInfo
Source§type Item = HistoryInfoEntry
type Item = HistoryInfoEntry
The type of the elements being iterated over.
Source§type IntoIter = IntoIter<HistoryInfoEntry>
type IntoIter = IntoIter<HistoryInfoEntry>
Which kind of iterator are we turning this into?
Source§fn into_iter(self) -> <HistoryInfo as IntoIterator>::IntoIter
fn into_iter(self) -> <HistoryInfo as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
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.