DriveFileUrlBuilder

Struct DriveFileUrlBuilder 

Source
pub struct DriveFileUrlBuilder<C> { /* private fields */ }
Expand description

Builder for the build_file_from_url method.

Implementations§

Source§

impl<C> DriveFileUrlBuilder<C>

Source

pub fn with_url(client: C, url: Url) -> Self

Creates a builder with the client and URL of the upload source.

Source

pub fn as_request(&self) -> &Request

Gets the request object for reuse.

Source

pub fn folder(&mut self, folder: impl EntityRef<DriveFolder>) -> &mut Self

Sets the parent folder of the file.

Source

pub fn comment(&mut self, comment: impl Into<String>) -> &mut Self

Available on crate feature 12-48-0 only.

Sets the comment for the file.

Source

pub fn sensitive(&mut self, sensitive: bool) -> &mut Self

Sets whether the file contains NSFW content.

Source

pub fn use_existing_if_uploaded( &mut self, use_existing_if_uploaded: bool, ) -> &mut Self

Sets whether or not to upload the file again even if the same content has already been uploaded.

Source§

impl<C: Client> DriveFileUrlBuilder<C>

Source

pub async fn upload(&self) -> Result<(), Error<C::Error>>

Available on crate feature 12-48-0 only.

Uploads the file.

The difference between upload_ and this method is that the former can get the DriveFile of the uploaded file, while the latter cannot. If you want to obtain the DriveFile of an uploaded file in v12.48.0 or later, you can use upload_and_wait or download the file once on the client side and the use UploadFileClientExt::upload_file to upload it.

Source

pub async fn upload_(&self) -> Result<DriveFile, Error<C::Error>>

Available on non-crate feature 12-48-0 only.

Uploads the file.

See upload for the difference between them.

Source§

impl<C> DriveFileUrlBuilder<C>
where C: StreamingClient<Error = <C as Client>::Error> + Client,

Source

pub async fn upload_and_wait( &self, ) -> Result<DriveFile, Error<<C as Client>::Error>>

Available on crate feature 12-48-0 only.

Uploads the file and wait for a message of completion from the server.

Unlike upload, this method returns DriveFile.

§Note on the use of main stream

This method is implemented by waiting for the upload completion event in the main stream. However, it is currently not possible to have multiple connections to the main stream from the same client. Therefore, when you use this method, you must not not be connected to the main stream elsewhere. Likewise, you will not be able to connect to the main stream until this method is completed.

Auto Trait Implementations§

§

impl<C> Freeze for DriveFileUrlBuilder<C>
where C: Freeze,

§

impl<C> RefUnwindSafe for DriveFileUrlBuilder<C>
where C: RefUnwindSafe,

§

impl<C> Send for DriveFileUrlBuilder<C>
where C: Send,

§

impl<C> Sync for DriveFileUrlBuilder<C>
where C: Sync,

§

impl<C> Unpin for DriveFileUrlBuilder<C>
where C: Unpin,

§

impl<C> UnwindSafe for DriveFileUrlBuilder<C>
where C: UnwindSafe,

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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> ErasedDestructor for T
where T: 'static,