pub struct AsyncRingSourceProvider { /* private fields */ }Expand description
A ringbuffer Producer meant for wrapping Source to make decode & playback async and keep the buffer filled without having audible gaps.
The implementation of the Producer is meant for async code, awaiting to fully put data on the ringbuffer OR waiting for seek events.
Implementations§
Source§impl AsyncRingSourceProvider
impl AsyncRingSourceProvider
Sourcepub fn is_closed(&self) -> bool
pub fn is_closed(&self) -> bool
Check if the consumer (AsyncRingSource) is still connected and writes are possible
Sourcepub async fn new_spec(
&mut self,
spec: SignalSpec,
current_span_len: usize,
) -> Result<usize, ()>
pub async fn new_spec( &mut self, spec: SignalSpec, current_span_len: usize, ) -> Result<usize, ()>
Sourcepub async fn process_seek(
&mut self,
spec: SignalSpec,
current_span_len: usize,
cb: Sender<usize>,
)
pub async fn process_seek( &mut self, spec: SignalSpec, current_span_len: usize, cb: Sender<usize>, )
Process a seek and call the Consumer to resume.
This clear all data state, calls the consumer to resume with how many bytes to skip and sends the new spec (in case it changed in the seek).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AsyncRingSourceProvider
impl !RefUnwindSafe for AsyncRingSourceProvider
impl Send for AsyncRingSourceProvider
impl Sync for AsyncRingSourceProvider
impl Unpin for AsyncRingSourceProvider
impl !UnwindSafe for AsyncRingSourceProvider
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
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request