Struct gphoto::Storage [] [src]

pub struct Storage {
    // some fields omitted
}

Structure containing information about a camera's storage.

Example

A Storage object can be used to retrieve information about a camera's storage:

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

for storage in camera.storage(&mut context).unwrap() {
    println!("       base dir = {:?}", storage.base_dir());
    println!("          label = {:?}", storage.label());
    println!("    description = {:?}", storage.description());
    println!("   storage type = {:?}", storage.storage_type());
    println!("filesystem type = {:?}", storage.filesystem_type());
    println!("    access type = {:?}", storage.access_type());
    println!("    capacity kb = {:?}", storage.capacity_kbytes());
    println!("        free kb = {:?}", storage.free_kbytes());
    println!("    free images = {:?}", storage.free_images());
}

The above example might print something like the following:

       base dir = Some("/store_00010001")
          label = Some("NIKON D750  [Slot 1]")
    description = None
   storage type = Some(RemoveableRam)
filesystem type = Some(DCF)
    access type = Some(ReadDelete)
    capacity kb = Some(31154688)
        free kb = Some(30833088)
    free images = Some(580)

Methods

impl Storage

fn base_dir(&self) -> Option<Cow<str>>

Base directory of the storage.

fn label(&self) -> Option<Cow<str>>

The storage's label.

fn description(&self) -> Option<Cow<str>>

A description of the storage.

fn storage_type(&self) -> Option<StorageType>

The storage's hardware type.

fn filesystem_type(&self) -> Option<FilesystemType>

The hiearchy type of the storage's filesystem.

fn access_type(&self) -> Option<AccessType>

The storage's access permissions.

fn capacity_kbytes(&self) -> Option<u64>

The storage's total capacity in kilobytes.

fn free_kbytes(&self) -> Option<u64>

The storage's free space in kilobytes.

fn free_images(&self) -> Option<u64>

An estimate of the number of images that could fit in the storage's remaining space.

This value is estimated by the camera.