[][src]Struct ucare::upload::Service

pub struct Service<'a> { /* fields omitted */ }

Service is used to make calls to file API.

Implementations

impl<'_> Service<'_>[src]

pub fn file(&self, params: FileParams) -> Result<ShortFileInfo>[src]

Uploads a file and return its unique id (uuid). Comply with the RFC7578 standard.

pub fn from_url(&self, params: FromUrlParams) -> Result<FromUrlData>[src]

Uploads file by its public URL.

pub fn from_url_status(&self, token: String) -> Result<FromUrlStatusData>[src]

Check the status of a file uploaded from URL.

pub fn file_info(&self, file_id: String) -> Result<FileInfo>[src]

Returns uploading file info.

pub fn create_group(&self, ids: &[&str]) -> Result<GroupInfo>[src]

Creates files group from a set of files by using their IDs with or without applied CDN media processing operations.

Example: [ "d6d34fa9-addd-472c-868d-2e5c105f9fcd", "b1026315-8116-4632-8364-607e64fca723/-/resize/x800/", ]

pub fn group_info(&self, group_id: String) -> Result<GroupInfo>[src]

Returns group specific info.

GroupID look like UUID~N, for example: "d52d7136-a2e5-4338-9f45-affbf83b857d~2"

pub fn multipart_start(&self, params: MultipartParams) -> Result<MultipartData>[src]

Multipart upload is useful when you are dealing with file larger than 100MB or explicitly want to use accelerated uploads. Another benefit is your file will go straight to AWS S3 bypassing our upload instances thus quickly becoming available for further use. Note, there also exists a minimum file size to use with Multipart Uploads, 10MB. Trying to use Multipart upload with a smaller file will result in an error.

pub fn upload_part(&self, url: String, data: Vec<u8>) -> Result<()>[src]

The second phase is about uploading file parts to the provided URLs. Each uploaded part should be 5MB (5242880 bytes) in size except for the last one that can be smaller. You can upload file parts in parallel provided the byte order stays unchanged. Make sure to define Content-Type header for your data.

pub fn multipart_complete(&self, uuid: String) -> Result<FileInfo>[src]

Complete multipart upload transaction when all file parts are uploaded

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Service<'a>

impl<'a> !Send for Service<'a>

impl<'a> !Sync for Service<'a>

impl<'a> Unpin for Service<'a>

impl<'a> !UnwindSafe for Service<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.