pub enum DeviceRequest {
GetMaxTransferSize {
responder: DeviceGetMaxTransferSizeResponder,
},
SetBitrate {
bitrate: u32,
responder: DeviceSetBitrateResponder,
},
Transact {
op: Vec<I2cImplOp>,
responder: DeviceTransactResponder,
},
#[non_exhaustive] _UnknownMethod {
ordinal: u64,
method_type: MethodType,
},
}Expand description
Low-level protocol for i2c drivers.
Variants§
GetMaxTransferSize
Fields
§
responder: DeviceGetMaxTransferSizeResponderSetBitrate
Sets the bitrate for the i2c bus in KHz units.
Transact
|Transact| assumes that write ops write_data length are not zero. |Transact| assumes that at least the last op has stop set to true.
For each read-transaction, there will be a corresponding ReadData returned. Write-transactions produce no data result.
#[non_exhaustive]_UnknownMethod
An interaction was received which does not match any known method.
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§
method_type: MethodTypeImplementations§
Source§impl DeviceRequest
impl DeviceRequest
pub fn into_get_max_transfer_size( self, ) -> Option<DeviceGetMaxTransferSizeResponder>
pub fn into_set_bitrate(self) -> Option<(u32, DeviceSetBitrateResponder)>
pub fn into_transact(self) -> Option<(Vec<I2cImplOp>, DeviceTransactResponder)>
pub fn new_get_max_transfer_size(self, tx_id: u32) -> Self
pub fn new_set_bitrate(self, bitrate: u32, tx_id: u32) -> Self
pub fn new_transact(self, op: Vec<I2cImplOp>, tx_id: u32) -> Self
pub fn get_max_transfer_size_as_message( arena: Arena, tx_id: u32, ) -> Result<Message<[u8]>, Error>
pub fn set_bitrate_as_message( arena: Arena, bitrate: u32, tx_id: u32, ) -> Result<Message<[u8]>, Error>
pub fn transact_as_message( arena: Arena, op: &[I2cImplOp], tx_id: u32, ) -> Result<Message<[u8]>, Error>
pub fn read_from( bytes: &[u8], _handles: &mut [HandleInfo], ) -> Result<Self, Error>
pub fn read_from_message(message: Message<[u8]>) -> Result<(Arena, Self), Error>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL
Trait Implementations§
Source§impl Debug for DeviceRequest
impl Debug for DeviceRequest
Source§impl TryFrom<Message<[u8]>> for DeviceRequest
Available on crate feature driver only.Like DeviceRequest::read_from_message except it drops the [Arena].
impl TryFrom<Message<[u8]>> for DeviceRequest
Available on crate feature
driver only.Like DeviceRequest::read_from_message except it drops the [Arena].
Auto Trait Implementations§
impl Freeze for DeviceRequest
impl RefUnwindSafe for DeviceRequest
impl Send for DeviceRequest
impl Sync for DeviceRequest
impl Unpin for DeviceRequest
impl UnsafeUnpin for DeviceRequest
impl UnwindSafe for DeviceRequest
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