pub struct ObjectHandle(pub u32);Expand description
32-bit object handle assigned by the device.
Tuple Fields§
§0: u32Implementations§
Source§impl ObjectHandle
impl ObjectHandle
Sourcepub const SEND_ROOT: Self
pub const SEND_ROOT: Self
Storage root as the destination of a new object: SendObjectInfo
parameter 2.
MTP 1.1 D.2.12 is explicit: “If the initiator wishes to place an object
in the root of a given storage, it shall indicate the desired storage in
the first parameter and include a value of 0xFFFFFFFF in the second
parameter.” A 0 there means “no parent specified, responder may
choose”, so responders look it up as a handle and reject it: Android’s
MtpServer only maps MTP_PARENT_ROOT (0xFFFFFFFF) to the storage path,
and libhaze (Nintendo Switch homebrew, #21) only maps 0xFFFFFFFF to its
storage object. Both answer 0 with InvalidObjectHandle.
The spec is asymmetric, so don’t unify this with ObjectHandle::ROOT:
MoveObject/CopyObject (D.2.25/D.2.26) spell the same destination
0x00000000.
Trait Implementations§
Source§impl Clone for ObjectHandle
impl Clone for ObjectHandle
Source§fn clone(&self) -> ObjectHandle
fn clone(&self) -> ObjectHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more