Skip to main content

AsyncAttachmentService

Trait AsyncAttachmentService 

Source
pub trait AsyncAttachmentService<I>
where I: Stream<Item = Result<Bytes, Error>>,
{ // Required methods fn create( &self, auth_: &BearerToken, request: &CreateAttachmentRequest, ) -> impl Future<Output = Result<Attachment, Error>> + Send; fn get( &self, auth_: &BearerToken, rid: &AttachmentRid, ) -> impl Future<Output = Result<Attachment, Error>> + Send; fn get_batch( &self, auth_: &BearerToken, request: &GetAttachmentsRequest, ) -> impl Future<Output = Result<GetAttachmentsResponse, Error>> + Send; fn get_content( &self, auth_: &BearerToken, rid: &AttachmentRid, ) -> impl Future<Output = Result<I, Error>> + Send; fn get_uri( &self, auth_: &BearerToken, rid: &AttachmentRid, ) -> impl Future<Output = Result<AttachmentUri, Error>> + Send; fn update( &self, auth_: &BearerToken, rid: &AttachmentRid, request: &UpdateAttachmentRequest, ) -> impl Future<Output = Result<Attachment, Error>> + Send; fn archive( &self, auth_: &BearerToken, rid: &AttachmentRid, ) -> impl Future<Output = Result<(), Error>> + Send; fn unarchive( &self, auth_: &BearerToken, rid: &AttachmentRid, ) -> impl Future<Output = Result<(), Error>> + Send; }
Expand description

The attachment service provides functionality for creating, updating, and archiving attachments uploaded to S3.

Required Methods§

Source

fn create( &self, auth_: &BearerToken, request: &CreateAttachmentRequest, ) -> impl Future<Output = Result<Attachment, Error>> + Send

Create a new attachment. Assumes the file is already uploaded to S3 through the upload service.

Source

fn get( &self, auth_: &BearerToken, rid: &AttachmentRid, ) -> impl Future<Output = Result<Attachment, Error>> + Send

Get an attachment by its RID.

Source

fn get_batch( &self, auth_: &BearerToken, request: &GetAttachmentsRequest, ) -> impl Future<Output = Result<GetAttachmentsResponse, Error>> + Send

Get a set of attachments by their RIDs.

Source

fn get_content( &self, auth_: &BearerToken, rid: &AttachmentRid, ) -> impl Future<Output = Result<I, Error>> + Send

Get the binary content of an attachment.

Source

fn get_uri( &self, auth_: &BearerToken, rid: &AttachmentRid, ) -> impl Future<Output = Result<AttachmentUri, Error>> + Send

Get a pre-signed URI to download an attachment. The link expires in 1 minute.

Source

fn update( &self, auth_: &BearerToken, rid: &AttachmentRid, request: &UpdateAttachmentRequest, ) -> impl Future<Output = Result<Attachment, Error>> + Send

Update an attachment. Only the fields that are set in the request will be updated.

Source

fn archive( &self, auth_: &BearerToken, rid: &AttachmentRid, ) -> impl Future<Output = Result<(), Error>> + Send

Archive an attachment.

Source

fn unarchive( &self, auth_: &BearerToken, rid: &AttachmentRid, ) -> impl Future<Output = Result<(), Error>> + Send

Unarchive an attachment.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<I, __C> AsyncAttachmentService<I> for AsyncAttachmentServiceClient<__C>
where I: Stream<Item = Result<Bytes, Error>>, __C: AsyncClient<ResponseBody = I> + Sync + Send, <__C as AsyncClient>::ResponseBody: 'static + Send,