pub struct DeviceBus(/* private fields */);Expand description
The operating system’s device bus. This is represented by a device file in Linux which acts as a serial console to read and write HLAPI RPC messages.
Implementations§
source§impl DeviceBus
impl DeviceBus
sourcepub fn new<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn new<P: AsRef<Path>>(path: P) -> Result<Self>
Creates a new device bus at the specified path.
sourcepub fn call<T: ApiCall + Serialize>(&self, call: Call<T>) -> Result<Response<T>>
pub fn call<T: ApiCall + Serialize>(&self, call: Call<T>) -> Result<Response<T>>
Calls an RPC method. A convenience method for writing to the device bus and then reading an RPC value returned.
sourcepub fn find<D: RpcDevice>(&self) -> Result<Option<D>>
pub fn find<D: RpcDevice>(&self) -> Result<Option<D>>
Finds a device or module by its RpcDevice identifier.
sourcepub fn find_by_name<D: RpcDevice>(&self, name: &str) -> Result<Option<D>>
pub fn find_by_name<D: RpcDevice>(&self, name: &str) -> Result<Option<D>>
Finds a device or module by its name.
sourcepub fn write_message<T: ApiCall + Serialize>(
&self,
message: Call<T>,
) -> Result<()>
pub fn write_message<T: ApiCall + Serialize>( &self, message: Call<T>, ) -> Result<()>
Writes an RPC message.
sourcepub fn read_message<T: ApiCall>(&self) -> Result<Response<T>>
pub fn read_message<T: ApiCall>(&self) -> Result<Response<T>>
Reads an RPC message.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DeviceBus
impl !RefUnwindSafe for DeviceBus
impl !Send for DeviceBus
impl !Sync for DeviceBus
impl Unpin 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)