Skip to main content

OperationCode

Enum OperationCode 

Source
#[repr(u16)]
pub enum OperationCode {
Show 24 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, GetDevicePropDesc = 4_116, GetDevicePropValue = 4_117, SetDevicePropValue = 4_118, ResetDevicePropValue = 4_119, MoveObject = 4_121, CopyObject = 4_122, GetPartialObject = 4_123, GetObjectPropValue = 38_915, SetObjectPropValue = 38_916, 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.

§

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.

§

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

§

GetObjectPropValue = 38_915

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

§

SetObjectPropValue = 38_916

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

§

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 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for OperationCode

Source§

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

Formats the value using the given formatter. Read more
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 · 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 Copy for OperationCode

Source§

impl Eq for OperationCode

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.