Skip to main content

AudioEndpoint

Struct AudioEndpoint 

Source
#[non_exhaustive]
pub struct AudioEndpoint { pub destination: Option<String>, pub variables: Option<Variables>, }
Expand description

Audio device endpoint for portaudio, pulseaudio, or ALSA modules.

Wire format: {module}[/{destination}] where destination is typically empty or auto_answer (recognized by portaudio and pulseaudio).

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§destination: Option<String>

Destination string (e.g. auto_answer). None for bare module name.

§variables: Option<Variables>

Per-channel variables prepended as {key=value}.

Implementations§

Source§

impl AudioEndpoint

Source

pub fn new() -> Self

Create a new audio endpoint with no destination.

Source

pub fn with_destination(self, destination: impl Into<String>) -> Self

Set the destination string.

Source

pub fn fmt_with_prefix(&self, f: &mut Formatter<'_>, prefix: &str) -> Result

Format with the given module prefix (portaudio, pulseaudio, alsa), which the Endpoint variant supplies because this struct does not record which of the three modules it belongs to.

Renders for DialStringCarrier::EslApi; the Endpoint variants render for whichever carrier they were asked for.

Source

pub fn parse_with_prefix(s: &str, prefix: &str) -> Result<Self, OriginateError>

Parse from a dial string with the given module prefix.

Source§

impl AudioEndpoint

Source

pub fn with_variables(self, variables: Variables) -> Self

Set per-channel variables.

Trait Implementations§

Source§

impl Clone for AudioEndpoint

Source§

fn clone(&self) -> AudioEndpoint

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AudioEndpoint

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AudioEndpoint

Source§

fn default() -> AudioEndpoint

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for AudioEndpoint

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl DialString for AudioEndpoint

Source§

fn variables(&self) -> Option<&Variables>

Per-endpoint variables, if any.
Source§

fn variables_mut(&mut self) -> Option<&mut Variables>

Mutable access to per-endpoint variables.
Source§

fn set_variables(&mut self, vars: Option<Variables>)

Replace per-endpoint variables.
Source§

impl Display for AudioEndpoint

Warning: This Display impl exists only to satisfy the DialString: Display trait bound. The "audio" prefix is not a valid FreeSWITCH endpoint. Always use AudioEndpoint through Endpoint::PortAudio, Endpoint::PulseAudio, or Endpoint::Alsa which call fmt_with_prefix with the correct module name.

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for AudioEndpoint

Source§

impl PartialEq for AudioEndpoint

Source§

fn eq(&self, other: &AudioEndpoint) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for AudioEndpoint

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for AudioEndpoint

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.