pub struct DeviceBus { /* private fields */ }Expand description
A bus interface to the HLApi
Implementations§
Source§impl DeviceBus
impl DeviceBus
pub fn new(path: impl AsRef<Path>) -> Result<DeviceBus>
Sourcepub fn call<T: Serialize, R: Deserialize>(
&mut self,
msg: &Call<T>,
) -> Result<Response<R>>
pub fn call<T: Serialize, R: Deserialize>( &mut self, msg: &Call<T>, ) -> Result<Response<R>>
Calls a HLApi method and gets its response.
Sourcepub fn call_preserialized<R: Deserialize>(
&mut self,
msg: &[u8],
) -> Result<Response<R>>
pub fn call_preserialized<R: Deserialize>( &mut self, msg: &[u8], ) -> Result<Response<R>>
Calls a HLApi method and gets its response. Uses a pre-serialized string to help with optimizations for zero-argument functions.
Sourcepub fn wrap<T: IdentifiedDevice>(&mut self) -> Result<Option<T>>
pub fn wrap<T: IdentifiedDevice>(&mut self) -> Result<Option<T>>
Utility method to create a wrapper for a device of a certain type.
Auto Trait Implementations§
impl Freeze for DeviceBus
impl RefUnwindSafe for DeviceBus
impl Send for DeviceBus
impl Sync for DeviceBus
impl Unpin for DeviceBus
impl UnsafeUnpin for DeviceBus
impl UnwindSafe for DeviceBus
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