[−][src]Struct libnspire::Handle
A handle to a calculator.
Implementations
impl<T: UsbContext> Handle<T>
[src]
pub fn new(device: DeviceHandle<T>) -> Result<Self>
[src]
Create a new handle to a USB device.
pub fn is_cx_ii(&self) -> Result<bool>
[src]
Whether this device is a CX II, CAS or non-CAS.
pub fn info(&self) -> Result<Info>
[src]
pub fn screenshot(&self) -> Result<Image>
[src]
Take a screenshot.
pub fn move_file(&self, src: &str, dest: &str) -> Result<()>
[src]
Move/rename a file.
pub fn file_attr(&self, src: &str) -> Result<DirItem>
[src]
Get the attributes of a file or directory.
pub fn copy_file(&self, src: &str, dest: &str) -> Result<()>
[src]
Copy a file.
pub fn delete_file(&self, path: &str) -> Result<()>
[src]
Delete a file.
pub fn read_file(
&self,
path: &str,
buf: &mut [u8],
progress: &mut dyn FnMut(usize)
) -> Result<usize>
[src]
&self,
path: &str,
buf: &mut [u8],
progress: &mut dyn FnMut(usize)
) -> Result<usize>
Read a file. Returns the number of bytes read. You must pass a buffer large enough to read the entire file (or smaller if that's all you care about).
pub fn write_file(
&self,
path: &str,
buf: &[u8],
progress: &mut dyn FnMut(usize)
) -> Result<()>
[src]
&self,
path: &str,
buf: &[u8],
progress: &mut dyn FnMut(usize)
) -> Result<()>
Write a file.
pub fn send_os(&self, buf: &[u8], progress: &mut dyn FnMut(usize)) -> Result<()>
[src]
Send an OS update.
pub fn create_dir(&self, path: &str) -> Result<()>
[src]
Create a directory.
pub fn delete_dir(&self, path: &str) -> Result<()>
[src]
Delete a directory.
pub fn list_dir(&self, path: &str) -> Result<DirList>
[src]
Get the contents of a directory.
Trait Implementations
impl<T: UsbContext> Drop for Handle<T>
[src]
impl<T: UsbContext> Send for Handle<T>
[src]
impl<T: UsbContext> Sync for Handle<T>
[src]
impl<T: UsbContext> TryFrom<DeviceHandle<T>> for Handle<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Handle<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Unpin for Handle<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Handle<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,