pub struct OutputDevice<'a, const N: usize> { /* private fields */ }Expand description
Serializes writers; the callback never takes this lock.
Trait Implementations§
Source§impl<const N: usize> DirectBaseOperations for OutputDevice<'_, N>
impl<const N: usize> DirectBaseOperations for OutputDevice<'_, N>
Source§fn write(
&self,
_cx: &mut Context<'_>,
buffer: &[u8],
_: Size,
) -> Poll<Result<usize>>
fn write( &self, _cx: &mut Context<'_>, buffer: &[u8], _: Size, ) -> Poll<Result<usize>>
Enqueues whole frames, returning zero immediately when full. No alignment requirement on the byte slice; incomplete frames are rejected.
Source§fn flush(&self, _cx: &mut Context<'_>) -> Poll<Result<()>>
fn flush(&self, _cx: &mut Context<'_>) -> Poll<Result<()>>
Polls for queued PCM to be consumed. Success means submitted to the callback, not physically played by the hardware. Never waits or spins.
fn read( &self, _cx: &mut Context<'_>, _: &mut [u8], _: Size, ) -> Poll<Result<usize>>
fn control( &self, _cx: &mut Context<'_>, command: ControlCommandIdentifier, input: &AnyByLayout, output: &mut AnyByLayout, ) -> Poll<Result<()>>
fn read_until( &self, cx: &mut Context<'_>, buffer: &mut [u8], absolute_position: u64, delimiter: &[u8], ) -> Poll<Result<usize, Kind>>
fn write_pattern( &self, cx: &mut Context<'_>, pattern: &[u8], count: usize, absolute_position: u64, ) -> Poll<Result<usize, Kind>>
fn write_vectored( &self, cx: &mut Context<'_>, buffers: &[&[u8]], absolute_position: u64, ) -> Poll<Result<usize, Kind>>
fn read_sync( &self, buffer: &mut [u8], absolute_position: u64, ) -> Result<usize, Kind>
fn write_sync( &self, buffer: &[u8], absolute_position: u64, ) -> Result<usize, Kind>
fn flush_sync(&self) -> Result<(), Kind>
fn control_sync( &self, command: ControlCommandIdentifier, input: &AnyByLayout, output: &mut AnyByLayout, ) -> Result<(), Kind>
fn read_until_sync( &self, buffer: &mut [u8], absolute_position: u64, delimiter: &[u8], ) -> Result<usize, Kind>
fn write_pattern_sync( &self, pattern: &[u8], count: usize, absolute_position: u64, ) -> Result<usize, Kind>
fn write_vectored_sync( &self, buffers: &[&[u8]], absolute_position: u64, ) -> Result<usize, Kind>
§fn cancel_operation(&self, _operation: Operation)
fn cancel_operation(&self, _operation: Operation)
Detach the current operation’s registration; see
BaseOperations.fn open(&self) -> Result<(), Kind>
fn close(&self) -> Result<(), Kind>
fn set_position(&self, current: u64, position: &Position) -> Result<u64, Kind>
Source§impl<const N: usize> DirectCharacterDevice for OutputDevice<'_, N>
impl<const N: usize> DirectCharacterDevice for OutputDevice<'_, N>
Auto Trait Implementations§
impl<'a, const N: usize> !Freeze for OutputDevice<'a, N>
impl<'a, const N: usize> !RefUnwindSafe for OutputDevice<'a, N>
impl<'a, const N: usize> Send for OutputDevice<'a, N>
impl<'a, const N: usize> Sync for OutputDevice<'a, N>
impl<'a, const N: usize> Unpin for OutputDevice<'a, N>
impl<'a, const N: usize> UnsafeUnpin for OutputDevice<'a, N>
impl<'a, const N: usize> !UnwindSafe for OutputDevice<'a, N>
Blanket Implementations§
§impl<T> BaseOperations for Twhere
T: DirectBaseOperations,
impl<T> BaseOperations for Twhere
T: DirectBaseOperations,
fn read( &self, _: &mut Context, cx: &mut Context<'_>, buffer: &mut [u8], absolute_position: u64, ) -> Poll<Result<usize, Kind>>
fn write( &self, _: &mut Context, cx: &mut Context<'_>, buffer: &[u8], absolute_position: u64, ) -> Poll<Result<usize, Kind>>
fn flush(&self, _: &mut Context, cx: &mut Context<'_>) -> Poll<Result<(), Kind>>
fn control( &self, _: &mut Context, cx: &mut Context<'_>, command: ControlCommandIdentifier, input: &AnyByLayout, output: &mut AnyByLayout, ) -> Poll<Result<(), Kind>>
fn read_until( &self, _: &mut Context, cx: &mut Context<'_>, buffer: &mut [u8], absolute_position: u64, delimiter: &[u8], ) -> Poll<Result<usize, Kind>>
fn write_pattern( &self, _: &mut Context, cx: &mut Context<'_>, pattern: &[u8], count: usize, absolute_position: u64, ) -> Poll<Result<usize, Kind>>
fn write_vectored( &self, _: &mut Context, cx: &mut Context<'_>, buffers: &[&[u8]], absolute_position: u64, ) -> Poll<Result<usize, Kind>>
fn open(&self, _: &mut Context) -> Result<(), Kind>
fn close(&self, _: &mut Context) -> Result<(), Kind>
fn set_position( &self, _: &mut Context, current: u64, position: &Position, ) -> Result<u64, Kind>
fn clone_context(&self, _: &Context) -> Result<Context, Kind>
§fn cancel_operation(&self, _: &mut Context, operation: Operation)
fn cancel_operation(&self, _: &mut Context, operation: Operation)
Detach this opening’s registration after completion, error or cancellation.
This hook is idempotent and must not consume data or change the cursor.
Wake and drop retired wakers outside device locks.
fn read_sync( &self, context: &mut Context, buffer: &mut [u8], absolute_position: u64, ) -> Result<usize, Kind>
fn write_sync( &self, context: &mut Context, buffer: &[u8], absolute_position: u64, ) -> Result<usize, Kind>
fn flush_sync(&self, context: &mut Context) -> Result<(), Kind>
fn control_sync( &self, context: &mut Context, command: ControlCommandIdentifier, input: &AnyByLayout, output: &mut AnyByLayout, ) -> Result<(), Kind>
fn read_until_sync( &self, context: &mut Context, buffer: &mut [u8], absolute_position: u64, delimiter: &[u8], ) -> Result<usize, Kind>
fn write_pattern_sync( &self, context: &mut Context, pattern: &[u8], count: usize, absolute_position: u64, ) -> Result<usize, Kind>
fn write_vectored_sync( &self, context: &mut Context, buffers: &[&[u8]], absolute_position: u64, ) -> Result<usize, Kind>
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
§impl<T> CharacterDevice for Twhere
T: DirectCharacterDevice,
impl<T> CharacterDevice for Twhere
T: DirectCharacterDevice,
§fn readiness(&self, interests: ReadyEvents) -> Result<Option<ReadyEvents>, Kind>
fn readiness(&self, interests: ReadyEvents) -> Result<Option<ReadyEvents>, Kind>
Snapshot device readiness without consuming data. Return
None to use
the VFS fallback, which reports the requested read/write directions
allowed by the opening’s access mode. I/O on such devices may still suspend. Read more