pub struct SofiaChannelName<'a> { /* private fields */ }Expand description
Borrowed view of a parsed sofia channel name. No allocation.
Only sofia/... names parse; other drivers (loopback/..., error/...)
return None. All accessors return verbatim slices of the input: no
URL-decoding, no sip: stripping, no port splitting — callers decide.
Implementations§
Source§impl<'a> SofiaChannelName<'a>
impl<'a> SofiaChannelName<'a>
Sourcepub fn parse(name: &'a str) -> Option<Self>
pub fn parse(name: &'a str) -> Option<Self>
Parses a channel name; Some only for well-formed
sofia/<profile>/<destination> names (non-empty profile).
Sourcepub fn destination(&self) -> &'a str
pub fn destination(&self) -> &'a str
Raw third segment, verbatim. May contain further / (dial-string
tails), a sip: scheme, or a :port suffix.
Sourcepub fn user(&self) -> Option<&'a str>
pub fn user(&self) -> Option<&'a str>
Part of the destination before the last @, or None when there is
no @. The split is on the last @ because mod_sofia URL-decodes
the user part, which may therefore contain @; a host never can.
Sourcepub fn host(&self) -> Option<&'a str>
pub fn host(&self) -> Option<&'a str>
Part of the destination after the last @ (may include :port), or
None when there is no @. A destination without @ is ambiguous
(bare host on inbound, user/number on gateway dials) — use
destination and decide from context.
Trait Implementations§
Source§impl<'a> Clone for SofiaChannelName<'a>
impl<'a> Clone for SofiaChannelName<'a>
Source§fn clone(&self) -> SofiaChannelName<'a>
fn clone(&self) -> SofiaChannelName<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for SofiaChannelName<'a>
Source§impl<'a> Debug for SofiaChannelName<'a>
impl<'a> Debug for SofiaChannelName<'a>
impl<'a> Eq for SofiaChannelName<'a>
Source§impl<'a> PartialEq for SofiaChannelName<'a>
impl<'a> PartialEq for SofiaChannelName<'a>
Source§fn eq(&self, other: &SofiaChannelName<'a>) -> bool
fn eq(&self, other: &SofiaChannelName<'a>) -> bool
self and other values to be equal, and is used by ==.impl<'a> StructuralPartialEq for SofiaChannelName<'a>
Auto Trait Implementations§
impl<'a> Freeze for SofiaChannelName<'a>
impl<'a> RefUnwindSafe for SofiaChannelName<'a>
impl<'a> Send for SofiaChannelName<'a>
impl<'a> Sync for SofiaChannelName<'a>
impl<'a> Unpin for SofiaChannelName<'a>
impl<'a> UnsafeUnpin for SofiaChannelName<'a>
impl<'a> UnwindSafe for SofiaChannelName<'a>
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
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
key and return true if they are equal.