[][src]Struct libptp::Camera

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

Implementations

impl<T: UsbContext> Camera<T>[src]

pub fn new(device: &Device<T>) -> Result<Camera<T>, Error>[src]

pub fn command(
    &mut self,
    code: CommandCode,
    params: &[u32],
    data: Option<&[u8]>,
    timeout: Option<Duration>
) -> Result<Vec<u8>, Error>
[src]

execute a PTP transaction. consists of the following phases:

  • command
  • command data (optional, if data is Some)
  • response data (optional, if response contains a payload)
  • response status NB: each phase involves a separate USB transfer, and timeout is used for each phase, so the total time taken may be greater than timeout.

pub fn get_objectinfo(
    &mut self,
    handle: u32,
    timeout: Option<Duration>
) -> Result<ObjectInfo, Error>
[src]

pub fn get_object(
    &mut self,
    handle: u32,
    timeout: Option<Duration>
) -> Result<Vec<u8>, Error>
[src]

pub fn get_partialobject(
    &mut self,
    handle: u32,
    offset: u32,
    max: u32,
    timeout: Option<Duration>
) -> Result<Vec<u8>, Error>
[src]

pub fn delete_object(
    &mut self,
    handle: u32,
    timeout: Option<Duration>
) -> Result<(), Error>
[src]

pub fn power_down(&mut self, timeout: Option<Duration>) -> Result<(), Error>[src]

pub fn get_objecthandles(
    &mut self,
    storage_id: u32,
    handle_id: u32,
    filter: Option<u32>,
    timeout: Option<Duration>
) -> Result<Vec<u32>, Error>
[src]

pub fn get_objecthandles_root(
    &mut self,
    storage_id: u32,
    filter: Option<u32>,
    timeout: Option<Duration>
) -> Result<Vec<u32>, Error>
[src]

pub fn get_objecthandles_all(
    &mut self,
    storage_id: u32,
    filter: Option<u32>,
    timeout: Option<Duration>
) -> Result<Vec<u32>, Error>
[src]

pub fn get_numobjects(
    &mut self,
    storage_id: u32,
    handle_id: u32,
    filter: Option<u32>,
    timeout: Option<Duration>
) -> Result<u32, Error>
[src]

pub fn get_storage_info(
    &mut self,
    storage_id: u32,
    timeout: Option<Duration>
) -> Result<StorageInfo, Error>
[src]

pub fn get_storageids(
    &mut self,
    timeout: Option<Duration>
) -> Result<Vec<u32>, Error>
[src]

pub fn get_numobjects_roots(
    &mut self,
    storage_id: u32,
    filter: Option<u32>,
    timeout: Option<Duration>
) -> Result<u32, Error>
[src]

pub fn get_numobjects_all(
    &mut self,
    storage_id: u32,
    filter: Option<u32>,
    timeout: Option<Duration>
) -> Result<u32, Error>
[src]

pub fn get_device_info(
    &mut self,
    timeout: Option<Duration>
) -> Result<DeviceInfo, Error>
[src]

pub fn open_session(&mut self, timeout: Option<Duration>) -> Result<(), Error>[src]

pub fn close_session(&mut self, timeout: Option<Duration>) -> Result<(), Error>[src]

pub fn disconnect(&mut self, timeout: Option<Duration>) -> Result<(), Error>[src]

pub fn reset(&mut self) -> Result<(), Error>[src]

pub fn clear_halt(&mut self) -> Result<(), Error>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Camera<T>[src]

impl<T> Send for Camera<T>[src]

impl<T> Sync for Camera<T>[src]

impl<T> Unpin for Camera<T>[src]

impl<T> UnwindSafe for Camera<T>[src]

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, 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.