pub struct VarName(/* private fields */);Expand description
The name of a FreeSWITCH channel variable, stored bare.
A dump spells its keys variable_sip_call_id while every other narration
(set, export, CoreSession::setVariable) spells the same variable
sip_call_id. This type holds the bare spelling once, and Display and
to_prefixed render the dump’s form for a reader.
It deliberately does not compare against &str. A consumer written against
the prefixed spelling — name == "variable_sip_call_id", or a
starts_with("variable_") filter — is the mistake this type exists to turn
into a compile error rather than a match that silently stops firing. Compare
against bare, or against a freeswitch-types variable enum’s
as_str.
Implementations§
Source§impl VarName
impl VarName
Sourcepub fn new(bare: impl Into<String>) -> Self
pub fn new(bare: impl Into<String>) -> Self
Wrap a name already stripped of the variable_ prefix.
Sourcepub fn from_prefixed(name: &str) -> Self
pub fn from_prefixed(name: &str) -> Self
Wrap a name that may carry the variable_ prefix, stripping it if so.
Sourcepub fn to_prefixed(&self) -> String
pub fn to_prefixed(&self) -> String
The prefixed name, as a CHANNEL_DATA dump spells it.
Trait Implementations§
impl Eq for VarName
impl StructuralPartialEq for VarName
Auto Trait Implementations§
impl Freeze for VarName
impl RefUnwindSafe for VarName
impl Send for VarName
impl Sync for VarName
impl Unpin for VarName
impl UnsafeUnpin for VarName
impl UnwindSafe for VarName
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.