pub enum Message<'r> {
Terminate,
Identifier(Uuid),
Silence,
Audio(Option<&'r [u8]>),
Error(Option<ErrorType>),
}
Expand description
AudioSocket message.
You may use RawMessage
to obtain one.
Variants§
Terminate
Message indicates that a connection was closed.
Closing socket also works.
Identifier(Uuid)
Message contains UUID of current stream.
Silence
Message indicates presence of silence on the line.
Audio(Option<&'r [u8]>)
Message possibly contains signed linear, 16-bit, 8kHz, mono PCM (little-endian) audio payload.
Error(Option<ErrorType>)
Message indicates Asterisk error, and possibly contains ErrorType
.
Trait Implementations§
Source§impl<'s> TryFrom<RawMessage<'s>> for Message<'s>
impl<'s> TryFrom<RawMessage<'s>> for Message<'s>
Source§type Error = AudioSocketError
type Error = AudioSocketError
The type returned in the event of a conversion error.
Source§fn try_from(
raw: RawMessage<'s>,
) -> Result<Self, <Message<'_> as TryFrom<RawMessage<'_>>>::Error>
fn try_from( raw: RawMessage<'s>, ) -> Result<Self, <Message<'_> as TryFrom<RawMessage<'_>>>::Error>
Performs the conversion.
impl<'r> Copy for Message<'r>
impl<'r> Eq for Message<'r>
impl<'r> StructuralPartialEq for Message<'r>
Auto Trait Implementations§
impl<'r> Freeze for Message<'r>
impl<'r> RefUnwindSafe for Message<'r>
impl<'r> Send for Message<'r>
impl<'r> Sync for Message<'r>
impl<'r> Unpin for Message<'r>
impl<'r> UnwindSafe for Message<'r>
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
Mutably borrows from an owned value. Read more