pub enum StreamPacket {
Pcm(PcmPacket),
Midi(MidiPacket),
Diagnostic(StreamDiagnostic),
Data(DataPacket),
}Expand description
Umbrella over every payload kind a stream envelope can carry.
Each variant maps to a StreamMedia kind and to a stream/packet/*
tagged Expr map. TryFrom<Expr>
reconstructs a packet from that encoding.
Variants§
Pcm(PcmPacket)
Real-time PCM audio frames.
Midi(MidiPacket)
Timed MIDI events.
Diagnostic(StreamDiagnostic)
In-band diagnostic message.
Data(DataPacket)
Opaque application-defined data.
Implementations§
Source§impl StreamPacket
impl StreamPacket
Sourcepub fn media(&self) -> StreamMedia
pub fn media(&self) -> StreamMedia
Returns the StreamMedia kind this payload belongs to.
Sourcepub fn data(kind: Symbol, payload: Expr) -> Self
pub fn data(kind: Symbol, payload: Expr) -> Self
Builds a StreamPacket::Data payload from a kind symbol and payload
expression.
Sourcepub fn model_event(payload: Expr) -> Self
pub fn model_event(payload: Expr) -> Self
Builds a stream/data/model-event data packet around payload.
Sourcepub fn rank_frontier(payload: Expr) -> Self
pub fn rank_frontier(payload: Expr) -> Self
Builds a stream/data/rank-frontier data packet around payload.
Trait Implementations§
Source§impl Clone for StreamPacket
impl Clone for StreamPacket
Source§fn clone(&self) -> StreamPacket
fn clone(&self) -> StreamPacket
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StreamPacket
impl Debug for StreamPacket
impl Eq for StreamPacket
Source§impl PartialEq for StreamPacket
impl PartialEq for StreamPacket
Source§fn eq(&self, other: &StreamPacket) -> bool
fn eq(&self, other: &StreamPacket) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for StreamPacket
Auto Trait Implementations§
impl Freeze for StreamPacket
impl RefUnwindSafe for StreamPacket
impl Send for StreamPacket
impl Sync for StreamPacket
impl Unpin for StreamPacket
impl UnsafeUnpin for StreamPacket
impl UnwindSafe for StreamPacket
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