[][src]Struct libnspire::Handle

pub struct Handle<T: UsbContext> { /* fields omitted */ }

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]

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]

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]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<T> RefUnwindSafe for Handle<T> where
    T: RefUnwindSafe

impl<T> Unpin for Handle<T> where
    T: Unpin

impl<T> UnwindSafe for Handle<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.