pub struct FlipperStorage { /* private fields */ }Expand description
Interface to Flipper device storage.
Implementations§
Source§impl FlipperStorage
impl FlipperStorage
Sourcepub fn new(port: Box<dyn SerialPort>) -> Self
pub fn new(port: Box<dyn SerialPort>) -> Self
Create new FlipperStorage connected to a SerialPort.
Sourcepub fn port(&self) -> &dyn SerialPort
pub fn port(&self) -> &dyn SerialPort
Get reference to underlying SerialPort.
Sourcepub fn port_mut(&mut self) -> &mut dyn SerialPort
pub fn port_mut(&mut self) -> &mut dyn SerialPort
Get mutable reference to underlying SerialPort.
Sourcepub fn list_tree(&mut self, path: &FlipperPath) -> Result<()>
pub fn list_tree(&mut self, path: &FlipperPath) -> Result<()>
List files and directories on the device.
Sourcepub fn send_file(
&mut self,
from: impl AsRef<Path>,
to: &FlipperPath,
) -> Result<()>
pub fn send_file( &mut self, from: impl AsRef<Path>, to: &FlipperPath, ) -> Result<()>
Send local file to the device.
Sourcepub fn receive_file(
&mut self,
from: &FlipperPath,
to: impl AsRef<Path>,
) -> Result<()>
pub fn receive_file( &mut self, from: &FlipperPath, to: impl AsRef<Path>, ) -> Result<()>
Receive remote file from the device.
Sourcepub fn read_file(&mut self, path: &FlipperPath) -> Result<BytesMut>
pub fn read_file(&mut self, path: &FlipperPath) -> Result<BytesMut>
Read file data from the device.
Sourcepub fn exist(&mut self, path: &FlipperPath) -> Result<bool>
pub fn exist(&mut self, path: &FlipperPath) -> Result<bool>
Does the file or directory exist on the device?
Sourcepub fn exist_dir(&mut self, path: &FlipperPath) -> Result<bool>
pub fn exist_dir(&mut self, path: &FlipperPath) -> Result<bool>
Does the directory exist on the device?
Sourcepub fn exist_file(&mut self, path: &FlipperPath) -> Result<bool>
pub fn exist_file(&mut self, path: &FlipperPath) -> Result<bool>
Does the file exist on the device?
Sourcepub fn size(&mut self, path: &FlipperPath) -> Result<usize>
pub fn size(&mut self, path: &FlipperPath) -> Result<usize>
File size in bytes
Sourcepub fn mkdir(&mut self, path: &FlipperPath) -> Result<()>
pub fn mkdir(&mut self, path: &FlipperPath) -> Result<()>
Make directory on the device.
Sourcepub fn format_ext(&mut self) -> Result<()>
pub fn format_ext(&mut self) -> Result<()>
Format external storage.
Sourcepub fn remove(&mut self, path: &FlipperPath) -> Result<()>
pub fn remove(&mut self, path: &FlipperPath) -> Result<()>
Remove file or directory.
Sourcepub fn md5sum(&mut self, path: &FlipperPath) -> Result<String>
pub fn md5sum(&mut self, path: &FlipperPath) -> Result<String>
Calculate MD5 hash of file.
Auto Trait Implementations§
impl Freeze for FlipperStorage
impl !RefUnwindSafe for FlipperStorage
impl Send for FlipperStorage
impl !Sync for FlipperStorage
impl Unpin for FlipperStorage
impl !UnwindSafe for FlipperStorage
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