Trait VercelBlobApi

Source
pub trait VercelBlobApi {
    // Required methods
    fn list<'life0, 'async_trait>(
        &'life0 self,
        options: ListCommandOptions,
    ) -> Pin<Box<dyn Future<Output = Result<ListBlobResult, VercelBlobError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn put<'life0, 'life1, 'async_trait>(
        &'life0 self,
        pathname: &'life1 str,
        body: impl 'async_trait + Into<Body> + Send,
        options: PutCommandOptions,
    ) -> Pin<Box<dyn Future<Output = Result<PutBlobResult, VercelBlobError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn head<'life0, 'life1, 'async_trait>(
        &'life0 self,
        url: &'life1 str,
        options: HeadCommandOptions,
    ) -> Pin<Box<dyn Future<Output = Result<Option<HeadBlobResult>, VercelBlobError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn del<'life0, 'life1, 'async_trait>(
        &'life0 self,
        url: &'life1 str,
        options: DelCommandOptions,
    ) -> Pin<Box<dyn Future<Output = Result<(), VercelBlobError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn download<'life0, 'life1, 'async_trait>(
        &'life0 self,
        url: &'life1 str,
        options: DownloadCommandOptions,
    ) -> Pin<Box<dyn Future<Output = Result<Bytes, VercelBlobError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Functions defined in the Vercel Blob API

Required Methods§

Source

fn list<'life0, 'async_trait>( &'life0 self, options: ListCommandOptions, ) -> Pin<Box<dyn Future<Output = Result<ListBlobResult, VercelBlobError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Lists files in the blob store

§Arguments
  • options - Options for the list operation
§Returns

The response from the list operation

Source

fn put<'life0, 'life1, 'async_trait>( &'life0 self, pathname: &'life1 str, body: impl 'async_trait + Into<Body> + Send, options: PutCommandOptions, ) -> Pin<Box<dyn Future<Output = Result<PutBlobResult, VercelBlobError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Uploads a file to the blob store

§Arguments
  • pathname - The destination pathname for the uploaded file
  • body - The contents of the file
  • options - Options for the put operation
§Returns

The response from the put operation. This includes a URL that can be used to later download the blob.

Source

fn head<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 str, options: HeadCommandOptions, ) -> Pin<Box<dyn Future<Output = Result<Option<HeadBlobResult>, VercelBlobError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Gets the metadata for a file in the blob store

§Arguments
  • url - The URL of the file to get metadata for. This should be the same URL that is used to download the file.
  • options - Options for the head operation
§Returns

If the file exists then the metadata for the file is returned. If the file does not exist then None is returned.

Source

fn del<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 str, options: DelCommandOptions, ) -> Pin<Box<dyn Future<Output = Result<(), VercelBlobError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Deletes a blob from the blob store

§Arguments
  • url - The URL of the file to delete. This should be the same URL that is used to download the file.
  • options - Options for the del operation
§Returns

None

Source

fn download<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 str, options: DownloadCommandOptions, ) -> Pin<Box<dyn Future<Output = Result<Bytes, VercelBlobError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Downloads a blob from the blob store

§Arguments
  • url - The URL of the file to download.
  • options - Options for the download operation
§Returns

The contents of the file

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§