pub struct HostCallbackQueue { /* private fields */ }Expand description
Cloneable handle host callbacks use to enqueue packets into a stream.
Wraps a push StreamValue and enforces that every enqueued packet matches
the device media. The handle is cheap to clone and callbacks enqueue through
non-blocking calls.
Implementations§
Source§impl HostCallbackQueue
impl HostCallbackQueue
Sourcepub fn new(stream: Arc<StreamValue>) -> Self
pub fn new(stream: Arc<StreamValue>) -> Self
Wraps a push stream, capturing its media for callback validation.
Sourcepub fn stream(&self) -> Arc<StreamValue>
pub fn stream(&self) -> Arc<StreamValue>
Returns a shared handle to the underlying stream value.
Sourcepub fn callback_packet(&self, packet: StreamPacket) -> Result<PushResult>
pub fn callback_packet(&self, packet: StreamPacket) -> Result<PushResult>
Enqueues a packet from a host callback after checking its media.
Sourcepub fn callback_item(&self, item: StreamItem) -> Result<PushResult>
pub fn callback_item(&self, item: StreamItem) -> Result<PushResult>
Enqueues a prebuilt stream item from a host callback after checking its media.
Sourcepub fn drain(&self, limit: usize) -> Result<Vec<StreamItem>>
pub fn drain(&self, limit: usize) -> Result<Vec<StreamItem>>
Removes up to limit buffered items from the stream.
Sourcepub fn stats(&self) -> Result<StreamStats>
pub fn stats(&self) -> Result<StreamStats>
Returns the current stream statistics.
Sourcepub fn inspector(
&self,
route: Symbol,
profile: &TransportProfile,
recent_diagnostics: Vec<Symbol>,
) -> Result<StreamInspectorSnapshot>
pub fn inspector( &self, route: Symbol, profile: &TransportProfile, recent_diagnostics: Vec<Symbol>, ) -> Result<StreamInspectorSnapshot>
Builds an inspector snapshot for the stream on the given route and transport profile.
Trait Implementations§
Source§impl Clone for HostCallbackQueue
impl Clone for HostCallbackQueue
Source§fn clone(&self) -> HostCallbackQueue
fn clone(&self) -> HostCallbackQueue
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 moreAuto Trait Implementations§
impl Freeze for HostCallbackQueue
impl RefUnwindSafe for HostCallbackQueue
impl Send for HostCallbackQueue
impl Sync for HostCallbackQueue
impl Unpin for HostCallbackQueue
impl UnsafeUnpin for HostCallbackQueue
impl UnwindSafe for HostCallbackQueue
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