pub struct File<'a> { /* private fields */ }
Expand description
Abstraction of a file object, it implements Object
, you may want to use
this struct to create a tree representation of one storage.
Implementations§
Source§impl File<'_>
impl File<'_>
Sourcepub fn storage_id(&self) -> u32
pub fn storage_id(&self) -> u32
Returns the id of the storage it belongs to.
Sourcepub fn modification_date(&self) -> DateTime<Utc>
pub fn modification_date(&self) -> DateTime<Utc>
Returns the latest modification date in UTC.
Trait Implementations§
Source§impl Object for &File<'_>
impl Object for &File<'_>
Source§fn device(&self) -> &MtpDevice
fn device(&self) -> &MtpDevice
Must return a valid reference of an
MtpDevice
, where this object resides in.Source§fn get_string(&self, property: Property) -> Result<String>
fn get_string(&self, property: Property) -> Result<String>
Retrieves a string from an object attribute.
Source§fn set_string(&self, property: Property, string: &str) -> Result<()>
fn set_string(&self, property: Property, string: &str) -> Result<()>
Sets an object attribute from a string.
Source§fn get_u64(&self, property: Property) -> Result<u64>
fn get_u64(&self, property: Property) -> Result<u64>
Retrieves an
u64
from an object attribute.Source§fn get_u32(&self, property: Property) -> Result<u32>
fn get_u32(&self, property: Property) -> Result<u32>
Retrieves an
u32
from an object attribute, returns the value of default
on failure.Source§fn set_u32(&self, property: Property, value: u32) -> Result<()>
fn set_u32(&self, property: Property, value: u32) -> Result<()>
Sets an object attribute from an
u32
.Source§fn get_u16(&self, property: Property) -> Result<u16>
fn get_u16(&self, property: Property) -> Result<u16>
Retrieves an
u16
from an object attribute, returns the value of default
on failure.Source§fn set_u16(&self, property: Property, value: u16) -> Result<()>
fn set_u16(&self, property: Property, value: u16) -> Result<()>
Sets an object attribute from an
u16
.Source§fn get_u8(&self, property: Property) -> Result<u8>
fn get_u8(&self, property: Property) -> Result<u8>
Retrieves an
u8
from an object attribute, returns the value of default
on failure.Source§fn set_u8(&self, property: Property, value: u8) -> Result<()>
fn set_u8(&self, property: Property, value: u8) -> Result<()>
Sets an object attribute from an
u8
.Source§fn delete(&self) -> Result<()>
fn delete(&self) -> Result<()>
Deletes a single file, track, playlist, folder or any other object off the MTP device.
Note that deleting folders may no be remove its contents, in turn this is the expected
behavior. Read more
Source§fn move_to(&self, storage_id: u32, parent: Parent) -> Result<()>
fn move_to(&self, storage_id: u32, parent: Parent) -> Result<()>
Moves the object to the specified storage (by its id) and parent folder. Moving objects
may or not be supported on the device. Read more
Source§fn copy_to(&self, storage_id: u32, parent: Parent) -> Result<()>
fn copy_to(&self, storage_id: u32, parent: Parent) -> Result<()>
Copies the object to the specified storage (by its id) and parent folder. Copying objects
may or not be supported on the device. Read more
Source§impl Object for File<'_>
impl Object for File<'_>
Source§fn device(&self) -> &MtpDevice
fn device(&self) -> &MtpDevice
Must return a valid reference of an
MtpDevice
, where this object resides in.Source§fn get_string(&self, property: Property) -> Result<String>
fn get_string(&self, property: Property) -> Result<String>
Retrieves a string from an object attribute.
Source§fn set_string(&self, property: Property, string: &str) -> Result<()>
fn set_string(&self, property: Property, string: &str) -> Result<()>
Sets an object attribute from a string.
Source§fn get_u64(&self, property: Property) -> Result<u64>
fn get_u64(&self, property: Property) -> Result<u64>
Retrieves an
u64
from an object attribute.Source§fn get_u32(&self, property: Property) -> Result<u32>
fn get_u32(&self, property: Property) -> Result<u32>
Retrieves an
u32
from an object attribute, returns the value of default
on failure.Source§fn set_u32(&self, property: Property, value: u32) -> Result<()>
fn set_u32(&self, property: Property, value: u32) -> Result<()>
Sets an object attribute from an
u32
.Source§fn get_u16(&self, property: Property) -> Result<u16>
fn get_u16(&self, property: Property) -> Result<u16>
Retrieves an
u16
from an object attribute, returns the value of default
on failure.Source§fn set_u16(&self, property: Property, value: u16) -> Result<()>
fn set_u16(&self, property: Property, value: u16) -> Result<()>
Sets an object attribute from an
u16
.Source§fn get_u8(&self, property: Property) -> Result<u8>
fn get_u8(&self, property: Property) -> Result<u8>
Retrieves an
u8
from an object attribute, returns the value of default
on failure.Source§fn set_u8(&self, property: Property, value: u8) -> Result<()>
fn set_u8(&self, property: Property, value: u8) -> Result<()>
Sets an object attribute from an
u8
.Source§fn delete(&self) -> Result<()>
fn delete(&self) -> Result<()>
Deletes a single file, track, playlist, folder or any other object off the MTP device.
Note that deleting folders may no be remove its contents, in turn this is the expected
behavior. Read more
Source§fn move_to(&self, storage_id: u32, parent: Parent) -> Result<()>
fn move_to(&self, storage_id: u32, parent: Parent) -> Result<()>
Moves the object to the specified storage (by its id) and parent folder. Moving objects
may or not be supported on the device. Read more
Source§fn copy_to(&self, storage_id: u32, parent: Parent) -> Result<()>
fn copy_to(&self, storage_id: u32, parent: Parent) -> Result<()>
Copies the object to the specified storage (by its id) and parent folder. Copying objects
may or not be supported on the device. Read more
Auto Trait Implementations§
impl<'a> Freeze for File<'a>
impl<'a> RefUnwindSafe for File<'a>
impl<'a> !Send for File<'a>
impl<'a> !Sync for File<'a>
impl<'a> Unpin for File<'a>
impl<'a> UnwindSafe for File<'a>
Blanket Implementations§
Source§impl<T> AsObjectId for Twhere
T: Object,
impl<T> AsObjectId for Twhere
T: Object,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more