FileUploader

Struct FileUploader 

Source
pub struct FileUploader<'a, P: AsRef<Path>, B = Body> { /* private fields */ }
Expand description

Client implementation to upload files and videos via the Wistia Upload API.

Also check out the rust-wistia docs for usage and examples.

Implementations§

Source§

impl<'a, P: AsRef<Path> + Debug> FileUploader<'a, P>

Source

pub fn new(file_path: P) -> Result<Self>

Create a FileUploader with a new HTTPS client, with the access token retrieved from the environment.

§Arguments
  • file_path - The path to the media file. The contents of this file will be multipart-form encoded into the request body.
Source

pub fn with_token(file_path: P, access_token: &str) -> Self

Create a FileUploader with a new HTTPS client and a Wistia access token.

§Arguments
  • file_path - The path to the media file. The contents of this file will be multipart-form encoded into the request body.
  • access_token - An API access token used to make requests to the Wistia API.
Source

pub fn with_client(file_path: P, client: UploadClient<Body>) -> Self

Create a FileUploader with a file path and an HTTPS client.

§Arguments
  • file_path - The path to the media file. The contents of this file will be multipart-form encoded into the request body.
  • client - The HTTPS client (UploadClient) to use for requests. Note that the client must support multipart form requests, via a multipart::Body.
Source

pub fn project_id(self, project_id: &'a str) -> Self

The hashed id of the project to upload media into. If omitted, a new project will be created and uploaded to. The naming convention used for such projects is Uploads_YYYY-MM-DD.

Source

pub fn name(self, name: &'a str) -> Self

A display name to use for the media in Wistia. If omitted, the filename will be used instead. This field is limited to 255 characters.

Source

pub fn description(self, description: &'a str) -> Self

A description to use for the media in Wistia. You can use basic HTML here, but note that both HTML and CSS will be sanitized.

Source

pub fn contact_id(self, contact_id: &'a str) -> Self

A Wistia contact id, an integer value. If omitted, it will default to the contact_id of the account’s owner.

Source

pub async fn send(&self) -> Result<UploadResponse>

Send the Upload File request (with the multi-part form data) to the Wistia Upload API.

Trait Implementations§

Source§

impl<'a, P: Clone + AsRef<Path>, B: Clone> Clone for FileUploader<'a, P, B>

Source§

fn clone(&self) -> FileUploader<'a, P, B>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<'a, P, B> Freeze for FileUploader<'a, P, B>
where P: Freeze,

§

impl<'a, P, B = Body> !RefUnwindSafe for FileUploader<'a, P, B>

§

impl<'a, P, B> Send for FileUploader<'a, P, B>
where P: Send, B: Send,

§

impl<'a, P, B> Sync for FileUploader<'a, P, B>
where P: Sync, B: Send,

§

impl<'a, P, B> Unpin for FileUploader<'a, P, B>
where P: Unpin,

§

impl<'a, P, B = Body> !UnwindSafe for FileUploader<'a, P, B>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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