embassy-nrf

Crates

git

Versions

nrf52833

Flavors

Skip to main content

Endpoint

Struct Endpoint 

Source
pub struct Endpoint<'d, Dir> { /* private fields */ }
Expand description

USB endpoint.

Implementations§

Source§

impl<'d, Dir: EndpointDir> Endpoint<'d, Dir>

Source

pub fn wait_disabled(&mut self) -> impl Future<Output = ()> + use<'_, 'd, Dir>

Wait for the endpoint to be disabled

Trait Implementations§

Source§

impl<'d, Dir: EndpointDir> Endpoint for Endpoint<'d, Dir>

Source§

fn info(&self) -> &EndpointInfo

Get the endpoint address
Source§

async fn wait_enabled(&mut self)

Wait for the endpoint to be enabled.
Source§

impl<'d> EndpointIn for Endpoint<'d, In>

Source§

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

Write a single packet of data to the endpoint.
Source§

async fn write_transfer( &mut self, buf: &[u8], needs_zlp: bool, ) -> Result<(), EndpointError>

Write all the data from buf to the endpoint one wMaxPacketSize chunk at a time. Read more
Source§

impl<'d> EndpointOut for Endpoint<'d, Out>

Source§

async fn read(&mut self, buf: &mut [u8]) -> Result<usize, EndpointError>

Read a single packet of data from the endpoint, and return the actual length of the packet. Read more
Source§

async fn read_transfer( &mut self, buf: &mut [u8], ) -> Result<usize, EndpointError>

Read until the buffer is full or we receive a short packet from the USB host returning the actual length of the entire data block. Read more

Auto Trait Implementations§

§

impl<'d, Dir> Freeze for Endpoint<'d, Dir>
where PhantomData<(&'d (), Dir)>: Freeze,

§

impl<'d, Dir> RefUnwindSafe for Endpoint<'d, Dir>
where PhantomData<(&'d (), Dir)>: RefUnwindSafe,

§

impl<'d, Dir> Send for Endpoint<'d, Dir>
where PhantomData<(&'d (), Dir)>: Send,

§

impl<'d, Dir> Sync for Endpoint<'d, Dir>
where PhantomData<(&'d (), Dir)>: Sync,

§

impl<'d, Dir> Unpin for Endpoint<'d, Dir>
where PhantomData<(&'d (), Dir)>: Unpin,

§

impl<'d, Dir> UnsafeUnpin for Endpoint<'d, Dir>
where PhantomData<(&'d (), Dir)>: UnsafeUnpin,

§

impl<'d, Dir> UnwindSafe for Endpoint<'d, Dir>
where PhantomData<(&'d (), Dir)>: UnwindSafe,

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, <T as TryFrom<U>>::Error>

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.