Skip to main content

DeviceInfo

Struct DeviceInfo 

Source
pub struct DeviceInfo {
Show 14 fields pub standard_version: u16, pub vendor_extension_id: u32, pub vendor_extension_version: u16, pub vendor_extension_desc: String, pub functional_mode: u16, pub operations_supported: Vec<OperationCode>, pub events_supported: Vec<EventCode>, pub device_properties_supported: Vec<u16>, pub capture_formats: Vec<ObjectFormatCode>, pub playback_formats: Vec<ObjectFormatCode>, pub manufacturer: String, pub model: String, pub device_version: String, pub serial_number: String,
}
Expand description

Device information returned by GetDeviceInfo.

Contains device capabilities, manufacturer info, and supported operations.

Fields§

§standard_version: u16

PTP standard version (e.g., 100 = v1.00).

§vendor_extension_id: u32

Vendor extension ID (0 = no extension).

§vendor_extension_version: u16

Vendor extension version.

§vendor_extension_desc: String

Vendor extension description.

§functional_mode: u16

Functional mode (0 = standard).

§operations_supported: Vec<OperationCode>

Operations supported by the device.

§events_supported: Vec<EventCode>

Events supported by the device.

§device_properties_supported: Vec<u16>

Device properties supported.

§capture_formats: Vec<ObjectFormatCode>

Object formats the device can capture/create.

§playback_formats: Vec<ObjectFormatCode>

Object formats the device can play/display.

§manufacturer: String

Manufacturer name.

§model: String

Device model name.

§device_version: String

Device version string.

§serial_number: String

Device serial number.

Implementations§

Source§

impl DeviceInfo

Source

pub fn from_bytes(buf: &[u8]) -> Result<Self, Error>

Parse DeviceInfo from a byte buffer.

The buffer should contain the DeviceInfo dataset as returned by GetDeviceInfo.

Source

pub fn supports_operation(&self, operation: OperationCode) -> bool

Check if the device supports a specific operation.

§Arguments
  • operation - The operation code to check
§Returns

Returns true if the operation is in the device’s supported operations list.

Source

pub fn supports_rename(&self) -> bool

Check if the device supports renaming objects.

This checks for support of the SetObjectPropValue operation (0x9804), which is required to rename files and folders via the ObjectFileName property.

§Returns

Returns true if the device advertises SetObjectPropValue support.

Trait Implementations§

Source§

impl Clone for DeviceInfo

Source§

fn clone(&self) -> DeviceInfo

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DeviceInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DeviceInfo

Source§

fn default() -> DeviceInfo

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.