pub enum RequestType {
Standard,
Class,
Vendor,
Undefined,
// some variants omitted
}Expand description
Setup request type (bits [6:5] of bmRequestType), as defined in USB 2.0 specification Table 9-2.
Variants§
Implementations§
Source§impl RequestType
impl RequestType
pub fn from_primitive(prim: u8) -> Option<RequestType>
pub fn from_primitive_allow_unknown(prim: u8) -> RequestType
pub fn unknown() -> RequestType
pub const fn into_primitive(self) -> u8
pub fn is_unknown(&self) -> bool
Trait Implementations§
Source§impl Clone for RequestType
impl Clone for RequestType
Source§fn clone(&self) -> RequestType
fn clone(&self) -> RequestType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for RequestType
Source§impl Debug for RequestType
impl Debug for RequestType
Source§impl<D> Decode<RequestType, D> for RequestTypewhere
D: ResourceDialect,
impl<D> Decode<RequestType, D> for RequestTypewhere
D: ResourceDialect,
Source§fn new_empty() -> RequestType
fn new_empty() -> RequestType
Creates a valid instance of
Self. The specific value does not matter,
since it will be overwritten by decode.Source§impl<D> Encode<RequestType, D> for RequestTypewhere
D: ResourceDialect,
impl<D> Encode<RequestType, D> for RequestTypewhere
D: ResourceDialect,
impl Eq for RequestType
Source§impl Hash for RequestType
impl Hash for RequestType
Source§impl Ord for RequestType
impl Ord for RequestType
Source§fn cmp(&self, other: &RequestType) -> Ordering
fn cmp(&self, other: &RequestType) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for RequestType
impl PartialEq for RequestType
Source§impl PartialOrd for RequestType
impl PartialOrd for RequestType
impl StructuralPartialEq for RequestType
Source§impl TypeMarker for RequestType
impl TypeMarker for RequestType
Source§type Owned = RequestType
type Owned = RequestType
The owned Rust type which this FIDL type decodes into.
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Returns the minimum required alignment of the inline portion of the
encoded object. It must be a (nonzero) power of two.
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
Returns the size of the inline portion of the encoded object, including
padding for alignment. Must be a multiple of
inline_align.Source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Returns true if the memory layout of
Self::Owned matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned to a single memcpy. Read moreSource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Returns true if the memory layout of
Self::Owned matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned to a single memcpy.Source§impl ValueTypeMarker for RequestType
impl ValueTypeMarker for RequestType
Source§type Borrowed<'a> = RequestType
type Borrowed<'a> = RequestType
The Rust type to use for encoding. This is a particular
Encode<Self>
type cheaply obtainable from &Self::Owned. There are three cases: Read moreSource§fn borrow(
value: &<RequestType as TypeMarker>::Owned,
) -> <RequestType as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<RequestType as TypeMarker>::Owned, ) -> <RequestType as ValueTypeMarker>::Borrowed<'_>
Cheaply converts from
&Self::Owned to Self::Borrowed.Auto Trait Implementations§
impl Freeze for RequestType
impl RefUnwindSafe for RequestType
impl Send for RequestType
impl Sync for RequestType
impl Unpin for RequestType
impl UnsafeUnpin for RequestType
impl UnwindSafe for RequestType
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