Trait capsules::usb::Descriptor
[−]
[src]
pub trait Descriptor {
fn size(&self) -> usize;
fn write_to_unchecked(&self, buf: &[Cell<u8>]) -> usize;
fn write_to(&self, buf: &[Cell<u8>]) -> usize { ... }
}
Required Methods
fn size(&self) -> usize
Serialized size of Descriptor
fn write_to_unchecked(&self, buf: &[Cell<u8>]) -> usize
Same as write_to(), but doesn't check that buf is long enough
before indexing into it. This should be used only if the result
of size() is first consulted.
Provided Methods
fn write_to(&self, buf: &[Cell<u8>]) -> usize
Serialize the descriptor to a buffer for transmission on the bus
Implementors
impl Descriptor for DeviceDescriptorimpl Descriptor for ConfigurationDescriptorimpl Descriptor for InterfaceDescriptorimpl<'a> Descriptor for LanguagesDescriptor<'a>impl<'a> Descriptor for StringDescriptor<'a>