pub struct DriveFile {
pub id: String,
pub name: String,
pub mime_type: String,
pub size: Option<String>,
pub created_time: Option<DateTime<Utc>>,
pub modified_time: Option<DateTime<Utc>>,
pub parents: Vec<String>,
pub shared: bool,
pub web_view_link: Option<String>,
pub owners: Vec<Owner>,
pub permissions: Vec<Permission>,
pub trashed: bool,
}Expand description
Represents a file or folder in Google Drive.
Fields§
§id: String§name: String§mime_type: String§size: Option<String>File size in bytes. None for Google native docs (Docs, Sheets, Slides).
created_time: Option<DateTime<Utc>>§modified_time: Option<DateTime<Utc>>§parents: Vec<String>Parent folder IDs.
web_view_link: Option<String>§owners: Vec<Owner>§permissions: Vec<Permission>§trashed: boolImplementations§
Source§impl DriveFile
impl DriveFile
Sourcepub fn is_google_doc(&self) -> bool
pub fn is_google_doc(&self) -> bool
Returns true if this file is a Google native document (Docs, Sheets, Slides).
Sourcepub fn display_size(&self) -> String
pub fn display_size(&self) -> String
Returns a human-readable file size string.
- 0 bytes → “0 B”
- < 1 KB → “{n} B”
- < 1 MB → “{n.1} KB”
- < 1 GB → “{n.1} MB”
- else → “{n.2} GB”
Returns "-" when the size field is absent (e.g., Google native docs).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DriveFile
impl<'de> Deserialize<'de> for DriveFile
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for DriveFile
Auto Trait Implementations§
impl Freeze for DriveFile
impl RefUnwindSafe for DriveFile
impl Send for DriveFile
impl Sync for DriveFile
impl Unpin for DriveFile
impl UnsafeUnpin for DriveFile
impl UnwindSafe for DriveFile
Blanket Implementations§
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