pub struct NusbFastBoot { /* private fields */ }
Expand description
Nusb fastboot client
Implementations§
Source§impl NusbFastBoot
impl NusbFastBoot
Sourcepub fn find_fastboot_interface(info: &DeviceInfo) -> Option<u8>
pub fn find_fastboot_interface(info: &DeviceInfo) -> Option<u8>
Find fastboot interface within a USB device
Sourcepub fn from_interface(
interface: Interface,
) -> Result<Self, NusbFastBootOpenError>
pub fn from_interface( interface: Interface, ) -> Result<Self, NusbFastBootOpenError>
Create a fastboot client based on a USB interface. Interface is assumed to be a fastboot interface
Sourcepub fn from_device(
device: Device,
interface: u8,
) -> Result<Self, NusbFastBootOpenError>
pub fn from_device( device: Device, interface: u8, ) -> Result<Self, NusbFastBootOpenError>
Create a fastboot client based on a USB device. Interface number must be the fastboot interface
Sourcepub fn from_info(info: &DeviceInfo) -> Result<Self, NusbFastBootOpenError>
pub fn from_info(info: &DeviceInfo) -> Result<Self, NusbFastBootOpenError>
Create a fastboot client based on device info. The correct interface will automatically be determined
Sourcepub async fn get_var(&mut self, var: &str) -> Result<String, NusbFastBootError>
pub async fn get_var(&mut self, var: &str) -> Result<String, NusbFastBootError>
Get the named variable
The “all” variable is special; For that Self::get_all_vars should be used instead
Sourcepub async fn download(
&mut self,
size: u32,
) -> Result<DataDownload<'_>, NusbFastBootError>
pub async fn download( &mut self, size: u32, ) -> Result<DataDownload<'_>, NusbFastBootError>
Prepare a download of a given size
When successfull the DataDownload helper should be used to actually send the data
Sourcepub async fn flash(&mut self, target: &str) -> Result<(), NusbFastBootError>
pub async fn flash(&mut self, target: &str) -> Result<(), NusbFastBootError>
Flash downloaded data to a given target partition
Sourcepub async fn continue_boot(&mut self) -> Result<(), NusbFastBootError>
pub async fn continue_boot(&mut self) -> Result<(), NusbFastBootError>
Continue booting
Sourcepub async fn erase(&mut self, target: &str) -> Result<(), NusbFastBootError>
pub async fn erase(&mut self, target: &str) -> Result<(), NusbFastBootError>
Erasing the given target partition
Sourcepub async fn reboot(&mut self) -> Result<(), NusbFastBootError>
pub async fn reboot(&mut self) -> Result<(), NusbFastBootError>
Reboot the device
Sourcepub async fn reboot_bootloader(&mut self) -> Result<(), NusbFastBootError>
pub async fn reboot_bootloader(&mut self) -> Result<(), NusbFastBootError>
Reboot the device to the bootloader
Sourcepub async fn get_all_vars(
&mut self,
) -> Result<HashMap<String, String>, NusbFastBootError>
pub async fn get_all_vars( &mut self, ) -> Result<HashMap<String, String>, NusbFastBootError>
Retrieve all variables
Auto Trait Implementations§
impl Freeze for NusbFastBoot
impl RefUnwindSafe for NusbFastBoot
impl Send for NusbFastBoot
impl Sync for NusbFastBoot
impl Unpin for NusbFastBoot
impl UnwindSafe for NusbFastBoot
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