pub struct AudioSourceEpIn<'d, D: Driver<'d>> { /* private fields */ }Expand description
Used for writing sample rate information over the feedback endpoint. Look at In\Out directions from the host side.
Implementations§
Source§impl<'d, D: Driver<'d>> AudioSourceEpIn<'d, D>
impl<'d, D: Driver<'d>> AudioSourceEpIn<'d, D>
Sourcepub async fn write(&mut self, buf: &[u8]) -> Result<(), EndpointError>
pub async fn write(&mut self, buf: &[u8]) -> Result<(), EndpointError>
Write feedback data to the endpoint.
Sourcepub async fn write_as_chunks(
&mut self,
buf: &[u8],
needs_zlp: bool,
) -> Result<(), EndpointError>
pub async fn write_as_chunks( &mut self, buf: &[u8], needs_zlp: bool, ) -> Result<(), EndpointError>
Write all the data from buf to the endpoint one wMaxPacketSize chunk at a time.
Sourcepub async fn wait_enabled(&mut self)
pub async fn wait_enabled(&mut self)
Wait until the endpoint is enabled by the host (i.e., after the host sets the alternate setting with this endpoint). This is critical to call before writing to the endpoint, otherwise writes will fail with EndpointError::Disabled. The endpoint will be disabled again when the host deactivates the streaming interface or unconfigures the device.
Auto Trait Implementations§
impl<'d, D> Freeze for AudioSourceEpIn<'d, D>
impl<'d, D> RefUnwindSafe for AudioSourceEpIn<'d, D>
impl<'d, D> Send for AudioSourceEpIn<'d, D>
impl<'d, D> Sync for AudioSourceEpIn<'d, D>
impl<'d, D> Unpin for AudioSourceEpIn<'d, D>
impl<'d, D> UnwindSafe for AudioSourceEpIn<'d, D>
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