embassy-usb

Crates

git

Versions

default

Flavors

Skip to main content

FrameWriter

Struct FrameWriter 

Source
pub struct FrameWriter<'a, 'd, D: Driver<'d>> { /* private fields */ }
Expand description

Streaming writer for a single UVC video or still image frame.

Implementations§

Source§

impl<'a, 'd, D: Driver<'d>> FrameWriter<'a, 'd, D>

Source

pub async fn write(&mut self, chunk: &[u8]) -> Result<(), EndpointError>

Writes a chunk of frame payload bytes, flushing full packets as needed.

Source

pub async fn finish(self) -> Result<(), EndpointError>

Finishes the frame by sending the final packet with EOF set (and a ZLP for Bulk if needed).

Source

pub async fn abort(self) -> Result<(), EndpointError>

Aborts the frame by sending the final packet with ERR | EOF set so the host discards it.

Auto Trait Implementations§

§

impl<'a, 'd, D> !UnwindSafe for FrameWriter<'a, 'd, D>

§

impl<'a, 'd, D> Forget for FrameWriter<'a, 'd, D>

§

impl<'a, 'd, D> Freeze for FrameWriter<'a, 'd, D>
where &'a mut <D as Driver<'d>>::EndpointIn: Freeze,

§

impl<'a, 'd, D> Move for FrameWriter<'a, 'd, D>

§

impl<'a, 'd, D> RefUnwindSafe for FrameWriter<'a, 'd, D>
where &'a mut <D as Driver<'d>>::EndpointIn: RefUnwindSafe,

§

impl<'a, 'd, D> Send for FrameWriter<'a, 'd, D>
where &'a mut <D as Driver<'d>>::EndpointIn: Send,

§

impl<'a, 'd, D> Sync for FrameWriter<'a, 'd, D>
where &'a mut <D as Driver<'d>>::EndpointIn: Sync,

§

impl<'a, 'd, D> Unpin for FrameWriter<'a, 'd, D>
where &'a mut <D as Driver<'d>>::EndpointIn: Unpin,

§

impl<'a, 'd, D> UnsafeUnpin for FrameWriter<'a, 'd, D>
where &'a mut <D as Driver<'d>>::EndpointIn: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.