Call

Struct Call 

Source
pub struct Call { /* private fields */ }
Expand description

Represents an ongoing (as been answered) call.

Implementations§

Source§

impl Call

Source

pub async fn block_for_finished(&mut self)

Blocks until the call has finished (hang up and terminated the worker thread)

Source

pub async fn block_for_output_empty(&mut self)

Blocks until the output buffer is empty

This is typically useful when sending already recorded sound, and you want to make sure the playback is finished before proceeding.

Source

pub fn send_audio(&self, audio: Vec<f32>) -> Result<()>

Adds the given samples to the output audio buffer.

§Arguments
  • audio: Interleaved stereo f32 samples @ 48000Hz.
§Errors

Errors when failing to send the audio to the call. Most likely because the call has already ended.

Source

pub fn hangup(&self) -> Result<()>

Tries to hang up the call. Might fail if the call is already over.

Source

pub async fn recv(&mut self) -> Option<CallControl>

Receive the next control message from the call. Blocking until a message arrives.

Source

pub async fn recv_media(&mut self) -> Option<Media>

Receive the next media message from the call. Blocking until a message arrives.

Source

pub async fn recv_either( &mut self, ) -> Either<Option<CallControl>, Option<Media>>

Receive either the next control message or the next media message.

Source

pub fn get_remote_uri(&self) -> &String

Returns the remote URI

Source

pub fn is_finished(&self) -> bool

Returns the state of the underlying worker

true if the underlying worker as finished.

Trait Implementations§

Source§

impl Drop for Call

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Call

§

impl RefUnwindSafe for Call

§

impl Send for Call

§

impl Sync for Call

§

impl Unpin for Call

§

impl UnwindSafe for Call

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> 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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,