pub struct File {
pub authorization: DriveAuthorization,
pub content_type: String,
pub content_length: u64,
pub access_date: DateTime<Utc>,
pub create_date: DateTime<Utc>,
/* private fields */
}Fields§
§content_type: String§content_length: u64§access_date: DateTime<Utc>§create_date: DateTime<Utc>Implementations§
Source§impl File
impl File
pub fn from_json(json: &Value, authorization: DriveAuthorization) -> File
pub fn name(&self) -> &str
pub fn online(&self) -> bool
pub async fn download( &mut self, revalidate: bool, on_progress: Option<Progress>, ) -> Result<Vec<u8>>
pub async fn preview(&mut self, revalidate: bool) -> Result<Option<Vec<u8>>>
pub async fn upload(&mut self, on_progress: Option<Progress>) -> Result<()>
pub async fn copy(&self, path: &str) -> Result<()>
pub async fn text(&mut self) -> Result<String>
pub async fn json<T: DeserializeOwned>(&mut self) -> Result<T>
pub async fn remove(&mut self) -> Result<()>
pub async fn generate_access_code( &self, expiration: Option<u64>, ) -> Result<String>
pub async fn owner(&self) -> Result<Profile>
Trait Implementations§
Auto Trait Implementations§
impl Forget for File
impl Freeze for Filewhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
PhantomData<Platform>: Freeze,
PhantomData<ApiKey>: Freeze,
NonZero<i32>: Freeze,
Utc: Freeze,
impl Move for File
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnsafeUnpin for Filewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<Platform>: UnsafeUnpin,
PhantomData<ApiKey>: UnsafeUnpin,
NonZeroI32Inner: UnsafeUnpin,
Utc: UnsafeUnpin,
impl UnwindSafe for File
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