Skip to main content

Pipe

Struct Pipe 

Source
pub struct Pipe<'d, C: HostController> { /* private fields */ }
Expand description

An endpoint of an enumerated device.

Implementations§

Source§

impl<'d, C: HostController> Pipe<'d, C>

Source

pub fn address(&self) -> EndpointAddress

Endpoint number and direction.

Source

pub fn max_packet(&self) -> u16

Maximum packet size.

Source

pub fn transfer_type(&self) -> EndpointType

Bulk or interrupt.

Source

pub fn read(&self, buffer: &mut [u8]) -> HostResult<usize>

Receive one transfer, stopping at a short packet or when buffer is full.

Source

pub fn write(&self, data: &[u8]) -> HostResult<usize>

Send one transfer.

An empty data sends a single zero-length packet, which is how a bulk transfer is terminated early.

Trait Implementations§

Source§

impl<C: HostController> Drop for Pipe<'_, C>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<'d, C> !Freeze for Pipe<'d, C>

§

impl<'d, C> !RefUnwindSafe for Pipe<'d, C>

§

impl<'d, C> !Sync for Pipe<'d, C>

§

impl<'d, C> Forget for Pipe<'d, C>

§

impl<'d, C> Move for Pipe<'d, C>

§

impl<'d, C> Send for Pipe<'d, C>
where &'d C: Send,

§

impl<'d, C> Unpin for Pipe<'d, C>
where &'d C: Unpin,

§

impl<'d, C> UnsafeUnpin for Pipe<'d, C>

§

impl<'d, C> UnwindSafe for Pipe<'d, C>

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.