#[non_exhaustive]#[repr(u8)]pub enum ChannelState {
Show 14 variants
CsNew = 0,
CsInit = 1,
CsRouting = 2,
CsSoftExecute = 3,
CsExecute = 4,
CsExchangeMedia = 5,
CsPark = 6,
CsConsumeMedia = 7,
CsHibernate = 8,
CsReset = 9,
CsHangup = 10,
CsReporting = 11,
CsDestroy = 12,
CsNone = 13,
}Expand description
Channel state from switch_channel_state_t – carried in the Channel-State header
as a string (CS_ROUTING) and in Channel-State-Number as an integer.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
CsNew = 0
CsInit = 1
CsRouting = 2
CsSoftExecute = 3
CsExecute = 4
CsExchangeMedia = 5
CsPark = 6
CsConsumeMedia = 7
CsHibernate = 8
CsReset = 9
CsHangup = 10
CsReporting = 11
CsDestroy = 12
CsNone = 13
Implementations§
Source§impl ChannelState
impl ChannelState
Source§impl ChannelState
impl ChannelState
Sourcepub fn from_number(n: u8) -> Option<ChannelState>
pub fn from_number(n: u8) -> Option<ChannelState>
Parse from the Channel-State-Number integer header value.
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Whether the channel is gone: CS_DESTROY, and nothing else.
The session’s run loop exits on CS_DESTROY; CS_NONE is a
running_state sentinel the state machine aborts on if it ever reaches
it, so it ends nothing despite sorting above CS_DESTROY.
CHANNEL_STATE events carry no variable_* headers, so end-of-life
detected here cannot be paired with any channel variable from the same
event. The variable-bearing terminal event is CHANNEL_HANGUP_COMPLETE,
which is also where variable_hangup_cause first appears –
CHANNEL_HANGUP carries only the Hangup-Cause header.
Trait Implementations§
Source§impl Clone for ChannelState
impl Clone for ChannelState
Source§fn clone(&self) -> ChannelState
fn clone(&self) -> ChannelState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ChannelState
Source§impl Debug for ChannelState
impl Debug for ChannelState
Source§impl Display for ChannelState
impl Display for ChannelState
impl Eq for ChannelState
Source§impl FromStr for ChannelState
impl FromStr for ChannelState
Source§type Err = ParseChannelStateError
type Err = ParseChannelStateError
Source§fn from_str(s: &str) -> Result<ChannelState, <ChannelState as FromStr>::Err>
fn from_str(s: &str) -> Result<ChannelState, <ChannelState as FromStr>::Err>
s to return a value of this type. Read moreSource§impl Hash for ChannelState
impl Hash for ChannelState
Source§impl Ord for ChannelState
impl Ord for ChannelState
Source§fn cmp(&self, other: &ChannelState) -> Ordering
fn cmp(&self, other: &ChannelState) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ChannelState
impl PartialEq for ChannelState
Source§impl PartialOrd for ChannelState
impl PartialOrd for ChannelState
impl StructuralPartialEq for ChannelState
Auto Trait Implementations§
impl Freeze for ChannelState
impl RefUnwindSafe for ChannelState
impl Send for ChannelState
impl Sync for ChannelState
impl Unpin for ChannelState
impl UnsafeUnpin for ChannelState
impl UnwindSafe for ChannelState
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> Comparable<K> for Q
impl<Q, K> Comparable<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.