Struct nusb::descriptors::Endpoint
source · pub struct Endpoint<'a>(/* private fields */);
Expand description
Information about a USB endpoint, with access to any associated descriptors.
Implementations§
source§impl<'a> Endpoint<'a>
impl<'a> Endpoint<'a>
sourcepub fn descriptors(&self) -> impl Iterator<Item = Descriptor<'_>>
pub fn descriptors(&self) -> impl Iterator<Item = Descriptor<'_>>
Get the endpoint descriptor followed by all trailing descriptors up to the next endpoint or interface descriptor.
sourcepub fn transfer_type(&self) -> EndpointType
pub fn transfer_type(&self) -> EndpointType
Get the endpoint’s transfer type.
sourcepub fn max_packet_size(&self) -> usize
pub fn max_packet_size(&self) -> usize
Get the maximum packet size in bytes.
sourcepub fn packets_per_microframe(&self) -> u8
pub fn packets_per_microframe(&self) -> u8
For isochronous endpoints at high speed, get the number of packets per microframe (1, 2, or 3).
source§impl<'a> Endpoint<'a>
impl<'a> Endpoint<'a>
sourcepub fn attributes(&self) -> u8
pub fn attributes(&self) -> u8
Get the raw value of the bmAttributes
descriptor field.
See `transfer_type`` for the transfer type field.
sourcepub fn max_packet_size_raw(&self) -> u16
pub fn max_packet_size_raw(&self) -> u16
Get the raw value of the wMaxPacketSize
descriptor field.
See max_macket_size
and packets_per_microframe
for the parsed subfields.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Endpoint<'a>
impl<'a> RefUnwindSafe for Endpoint<'a>
impl<'a> Send for Endpoint<'a>
impl<'a> Sync for Endpoint<'a>
impl<'a> Unpin for Endpoint<'a>
impl<'a> UnwindSafe for Endpoint<'a>
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