pub struct UriInfo(/* private fields */);Expand description
Parsed <absoluteURI> *(SEMI generic-param) header value.
Used by Call-Info, Alert-Info, and Error-Info. Contains one or more entries.
use sip_header::UriInfo;
let raw = "<urn:example:call:123>;purpose=emergency-CallId,<https://example.com/data>;purpose=EmergencyCallData.ServiceInfo";
let info = UriInfo::parse(raw).unwrap();
assert_eq!(info.entries().len(), 2);
assert_eq!(info.entries()[0].purpose(), Some("emergency-CallId"));Implementations§
Source§impl UriInfo
impl UriInfo
Sourcepub fn parse(raw: &str) -> Result<UriInfo, UriInfoError>
pub fn parse(raw: &str) -> Result<UriInfo, UriInfoError>
Parse a comma-separated <absoluteURI> *(SEMI generic-param) value.
Sourcepub fn from_entries<'a>(
entries: impl IntoIterator<Item = &'a str>,
) -> Result<UriInfo, UriInfoError>
pub fn from_entries<'a>( entries: impl IntoIterator<Item = &'a str>, ) -> Result<UriInfo, UriInfoError>
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) -> &[UriInfoEntry]
pub fn entries(&self) -> &[UriInfoEntry]
The parsed entries as a slice.
Sourcepub fn into_entries(self) -> Vec<UriInfoEntry>
pub fn into_entries(self) -> Vec<UriInfoEntry>
Consume self and return the entries as a Vec.
Trait Implementations§
Source§impl<'a> IntoIterator for &'a UriInfo
impl<'a> IntoIterator for &'a UriInfo
Source§impl IntoIterator for UriInfo
impl IntoIterator for UriInfo
impl Eq for UriInfo
impl StructuralPartialEq for UriInfo
Auto Trait Implementations§
impl Freeze for UriInfo
impl RefUnwindSafe for UriInfo
impl Send for UriInfo
impl Sync for UriInfo
impl Unpin for UriInfo
impl UnsafeUnpin for UriInfo
impl UnwindSafe for UriInfo
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.