Skip to main content

OperationCode

Enum OperationCode 

Source
#[repr(u16)]
pub enum OperationCode {
Show 38 variants GetDeviceInfo = 4_097, OpenSession = 4_098, CloseSession = 4_099, GetStorageIds = 4_100, GetStorageInfo = 4_101, GetNumObjects = 4_102, GetObjectHandles = 4_103, GetObjectInfo = 4_104, GetObject = 4_105, GetThumb = 4_106, DeleteObject = 4_107, SendObjectInfo = 4_108, SendObject = 4_109, InitiateCapture = 4_110, FormatStore = 4_111, ResetDevice = 4_112, SelfTest = 4_113, SetObjectProtection = 4_114, PowerDown = 4_115, GetDevicePropDesc = 4_116, GetDevicePropValue = 4_117, SetDevicePropValue = 4_118, ResetDevicePropValue = 4_119, TerminateOpenCapture = 4_120, MoveObject = 4_121, CopyObject = 4_122, GetPartialObject = 4_123, InitiateOpenCapture = 4_124, GetObjectPropsSupported = 38_913, GetObjectPropDesc = 38_914, GetObjectPropValue = 38_915, SetObjectPropValue = 38_916, GetObjectPropList = 38_917, SetObjectPropList = 38_918, GetObjectReferences = 38_928, SetObjectReferences = 38_929, GetPartialObject64 = 38_337, Unknown(u16),
}
Expand description

PTP operation codes (commands sent to device).

These codes identify the operation being requested in a PTP command container.

Variants§

§

GetDeviceInfo = 4_097

Get device information (capabilities, manufacturer, etc.).

§

OpenSession = 4_098

Open a session with the device.

§

CloseSession = 4_099

Close the current session.

§

GetStorageIds = 4_100

Get list of storage IDs.

§

GetStorageInfo = 4_101

Get information about a storage.

§

GetNumObjects = 4_102

Get the number of objects in a storage/folder.

§

GetObjectHandles = 4_103

Get list of object handles.

§

GetObjectInfo = 4_104

Get information about an object.

§

GetObject = 4_105

Download an object’s data.

§

GetThumb = 4_106

Get thumbnail for an object.

§

DeleteObject = 4_107

Delete an object.

§

SendObjectInfo = 4_108

Send object metadata (before sending object data).

§

SendObject = 4_109

Send object data (after SendObjectInfo).

§

InitiateCapture = 4_110

Initiate image capture on a camera.

§

FormatStore = 4_111

Format (erase) a storage.

§

ResetDevice = 4_112

Reset the device to its default state, closing all sessions.

§

SelfTest = 4_113

Run a device self-test.

§

SetObjectProtection = 4_114

Set the write/delete protection status of an object.

§

PowerDown = 4_115

Power down the device.

§

GetDevicePropDesc = 4_116

Get device property descriptor.

§

GetDevicePropValue = 4_117

Get current device property value.

§

SetDevicePropValue = 4_118

Set device property value.

§

ResetDevicePropValue = 4_119

Reset device property to default value.

§

TerminateOpenCapture = 4_120

Terminate an open capture session.

§

MoveObject = 4_121

Move an object to a different location.

§

CopyObject = 4_122

Copy an object.

§

GetPartialObject = 4_123

Get partial object data (range request). Offset is u32, so capped at 4 GB.

§

InitiateOpenCapture = 4_124

Initiate an open-ended capture session.

§

GetObjectPropsSupported = 38_913

Get the object properties the device supports for a format (MTP extension).

§

GetObjectPropDesc = 38_914

Get an object property descriptor (MTP extension).

§

GetObjectPropValue = 38_915

Get the value of an object property (MTP extension).

§

SetObjectPropValue = 38_916

Set the value of an object property (MTP extension).

§

GetObjectPropList = 38_917

Get a list of object properties in one call (MTP extension).

§

SetObjectPropList = 38_918

Set a list of object properties in one call (MTP extension).

§

GetObjectReferences = 38_928

Get the references (associations) of an object (MTP extension).

§

SetObjectReferences = 38_929

Set the references (associations) of an object (MTP extension).

§

GetPartialObject64 = 38_337

Get partial object data with 64-bit offset (Android/MTP extension). Supports files larger than 4 GB. Parameters: handle, offset_lo, offset_hi, max_bytes.

§

Unknown(u16)

Unknown or vendor-specific operation code.

Trait Implementations§

Source§

impl Clone for OperationCode

Source§

fn clone(&self) -> OperationCode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for OperationCode

Source§

impl Debug for OperationCode

Source§

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

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

impl Eq for OperationCode

Source§

impl From<OperationCode> for u16

Source§

fn from(enum_value: OperationCode) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for OperationCode

Source§

fn from(number: u16) -> Self

Converts to this type from the input type.
Source§

impl FromPrimitive for OperationCode

Source§

type Primitive = u16

Source§

fn from_primitive(number: Self::Primitive) -> Self

Source§

impl Hash for OperationCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for OperationCode

Source§

fn eq(&self, other: &OperationCode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for OperationCode

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.