Struct gphoto::Abilities [] [src]

pub struct Abilities {
    // some fields omitted
}

Describes the abilities of a device.

Example

An Abilities object can be used to retrieve information about a camera's driver:

let mut context = gphoto::Context::new().unwrap();
let mut camera = gphoto::Camera::autodetect(&mut context).unwrap();
let abilities = camera.abilities();

println!("      device type = {:?}", abilities.device_type());
println!("            model = {:?}", abilities.model());
println!("    driver status = {:?}", abilities.driver_status());
println!("       port types = {:?}", abilities.port_types());
println!("           speeds = {:?}", abilities.speeds());
println!("camera operations = {:?}", abilities.camera_operations());
println!("  file operations = {:?}", abilities.file_operations());
println!("folder operations = {:?}", abilities.folder_operations());
println!("       USB vendor = {:?}", abilities.usb_vendor());
println!("      USB product = {:?}", abilities.usb_product());
println!("        USB class = {:?}", abilities.usb_class());
println!("     USB subclass = {:?}", abilities.usb_subclass());
println!("     USB protocol = {:?}", abilities.usb_protocol());

The above example may print something like the following:

      device type = Camera
            model = "Nikon DSC D750"
    driver status = Production
       port types = {USB}
           speeds = []
camera operations = {CaptureImage, TriggerCapture, Config, CapturePreview}
  file operations = {Delete, Preview}
folder operations = {MakeDirectory, RemoveDirectory, PutFile}
       USB vendor = 1200
      USB product = 1079
        USB class = 0
     USB subclass = 0
     USB protocol = 0

Methods

impl Abilities

fn device_type(&self) -> DeviceType

Returns the type of the device.

fn model(&self) -> Cow<str>

Returns the name of the camera's model.

fn driver_status(&self) -> DriverStatus

Returns the driver's stability status.

fn port_types(&self) -> HashSet<PortType>

Returns the supported port types.

fn speeds(&self) -> Vec<usize>

Returns the supported serial port speeds.

fn camera_operations(&self) -> HashSet<CameraOperation>

Returns the camera operations supported by the device.

fn file_operations(&self) -> HashSet<FileOperation>

Returns the file operations supported by the device.

fn folder_operations(&self) -> HashSet<FolderOperation>

Returns the folder operations supported by the device.

fn usb_vendor(&self) -> u16

USB vendor ID.

fn usb_product(&self) -> u16

USB product ID.

fn usb_class(&self) -> u8

USB device class.

fn usb_subclass(&self) -> u8

USB device subclass.

fn usb_protocol(&self) -> u8

USB device protocol.