pub struct Firmware(/* private fields */);Expand description
Abstraction around a C struct firmware.
This is a simple abstraction around the C firmware API. Just like with the C API, firmware can
be requested. Once requested the abstraction provides direct access to the firmware buffer as
&[u8]. The firmware is released once Firmware is dropped.
§Invariants
The pointer is valid, and has ownership over the instance of struct firmware.
The Firmware’s backing buffer is not modified.
§Examples
let fw = Firmware::request(c_str!("path/to/firmware.bin"), &dev)?;
let blob = fw.data();
Implementations§
Source§impl Firmware
impl Firmware
Sourcepub fn request(name: &CStr, dev: &Device) -> Result<Self>
pub fn request(name: &CStr, dev: &Device) -> Result<Self>
Send a firmware request and wait for it. See also bindings::request_firmware.
Sourcepub fn request_nowarn(name: &CStr, dev: &Device) -> Result<Self>
pub fn request_nowarn(name: &CStr, dev: &Device) -> Result<Self>
Send a request for an optional firmware module. See also
bindings::firmware_request_nowarn.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Firmware
impl RefUnwindSafe for Firmware
impl Unpin for Firmware
impl UnwindSafe for Firmware
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