Struct FileMetadata

Source
#[non_exhaustive]
pub struct FileMetadata {
Show 19 fields pub name: String, pub id: Id, pub client_modified: DropboxTimestamp, pub server_modified: DropboxTimestamp, pub rev: Rev, pub size: u64, pub path_lower: Option<String>, pub path_display: Option<String>, pub parent_shared_folder_id: Option<SharedFolderId>, pub preview_url: Option<String>, pub media_info: Option<MediaInfo>, pub symlink_info: Option<SymlinkInfo>, pub sharing_info: Option<FileSharingInfo>, pub is_downloadable: bool, pub export_info: Option<ExportInfo>, pub property_groups: Option<Vec<PropertyGroup>>, pub has_explicit_shared_members: Option<bool>, pub content_hash: Option<Sha256HexHash>, pub file_lock_info: Option<FileLockMetadata>,
}
Available on crate features async_routes and dbx_files only.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: String

The last component of the path (including extension). This never contains a slash.

§id: Id

A unique identifier for the file.

§client_modified: DropboxTimestamp

For files, this is the modification time set by the desktop client when the file was added to Dropbox. Since this time is not verified (the Dropbox server stores whatever the desktop client sends up), this should only be used for display purposes (such as sorting) and not, for example, to determine if a file has changed or not.

§server_modified: DropboxTimestamp

The last time the file was modified on Dropbox.

§rev: Rev

A unique identifier for the current revision of a file. This field is the same rev as elsewhere in the API and can be used to detect changes and avoid conflicts.

§size: u64

The file size in bytes.

§path_lower: Option<String>

The lowercased full path in the user’s Dropbox. This always starts with a slash. This field will be null if the file or folder is not mounted.

§path_display: Option<String>

The cased path to be used for display purposes only. In rare instances the casing will not correctly match the user’s filesystem, but this behavior will match the path provided in the Core API v1, and at least the last path component will have the correct casing. Changes to only the casing of paths won’t be returned by list_folder_continue(). This field will be null if the file or folder is not mounted.

§parent_shared_folder_id: Option<SharedFolderId>§preview_url: Option<String>

The preview URL of the file.

§media_info: Option<MediaInfo>

Additional information if the file is a photo or video. This field will not be set on entries returned by list_folder(), list_folder_continue(), or get_thumbnail_batch(), starting December 2, 2019.

§symlink_info: Option<SymlinkInfo>

Set if this file is a symlink.

§sharing_info: Option<FileSharingInfo>

Set if this file is contained in a shared folder.

§is_downloadable: bool

If true, file can be downloaded directly; else the file must be exported.

§export_info: Option<ExportInfo>

Information about format this file can be exported to. This filed must be set if is_downloadable is set to false.

§property_groups: Option<Vec<PropertyGroup>>

Additional information if the file has custom properties with the property template specified.

§has_explicit_shared_members: Option<bool>

This flag will only be present if include_has_explicit_shared_members is true in list_folder() or get_metadata(). If this flag is present, it will be true if this file has any explicit shared members. This is different from sharing_info in that this could be true in the case where a file has explicit members but is not contained within a shared folder.

§content_hash: Option<Sha256HexHash>

A hash of the file content. This field can be used to verify data integrity. For more information see our Content hash page.

§file_lock_info: Option<FileLockMetadata>

If present, the metadata associated with the file’s current lock.

Implementations§

Source§

impl FileMetadata

Source

pub fn new( name: String, id: Id, client_modified: DropboxTimestamp, server_modified: DropboxTimestamp, rev: Rev, size: u64, ) -> Self

Source

pub fn with_path_lower(self, value: String) -> Self

Source

pub fn with_path_display(self, value: String) -> Self

Source

pub fn with_parent_shared_folder_id(self, value: SharedFolderId) -> Self

Source

pub fn with_preview_url(self, value: String) -> Self

Source

pub fn with_media_info(self, value: MediaInfo) -> Self

Source

pub fn with_sharing_info(self, value: FileSharingInfo) -> Self

Source

pub fn with_is_downloadable(self, value: bool) -> Self

Source

pub fn with_export_info(self, value: ExportInfo) -> Self

Source

pub fn with_property_groups(self, value: Vec<PropertyGroup>) -> Self

Source

pub fn with_has_explicit_shared_members(self, value: bool) -> Self

Source

pub fn with_content_hash(self, value: Sha256HexHash) -> Self

Source

pub fn with_file_lock_info(self, value: FileLockMetadata) -> Self

Trait Implementations§

Source§

impl Clone for FileMetadata

Source§

fn clone(&self) -> FileMetadata

Returns a copy 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 FileMetadata

Source§

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

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

impl<'de> Deserialize<'de> for FileMetadata

Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<FileMetadata> for Metadata

Source§

fn from(subtype: FileMetadata) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for FileMetadata

Source§

fn eq(&self, other: &FileMetadata) -> 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 Serialize for FileMetadata

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for FileMetadata

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T