pub trait LocalAsyncAttachmentService<I: Stream<Item = Result<Bytes, Error>>> {
// Required methods
fn create(
&self,
auth_: &BearerToken,
request: &CreateAttachmentRequest,
) -> impl Future<Output = Result<Attachment, Error>>;
fn get(
&self,
auth_: &BearerToken,
rid: &AttachmentRid,
) -> impl Future<Output = Result<Attachment, Error>>;
fn get_batch(
&self,
auth_: &BearerToken,
request: &GetAttachmentsRequest,
) -> impl Future<Output = Result<GetAttachmentsResponse, Error>>;
fn get_content(
&self,
auth_: &BearerToken,
rid: &AttachmentRid,
) -> impl Future<Output = Result<I, Error>>;
fn get_uri(
&self,
auth_: &BearerToken,
rid: &AttachmentRid,
) -> impl Future<Output = Result<AttachmentUri, Error>>;
fn update(
&self,
auth_: &BearerToken,
rid: &AttachmentRid,
request: &UpdateAttachmentRequest,
) -> impl Future<Output = Result<Attachment, Error>>;
fn archive(
&self,
auth_: &BearerToken,
rid: &AttachmentRid,
) -> impl Future<Output = Result<(), Error>>;
fn unarchive(
&self,
auth_: &BearerToken,
rid: &AttachmentRid,
) -> impl Future<Output = Result<(), Error>>;
}Expand description
The attachment service provides functionality for creating, updating, and archiving attachments uploaded to S3.
Required Methods§
Sourcefn create(
&self,
auth_: &BearerToken,
request: &CreateAttachmentRequest,
) -> impl Future<Output = Result<Attachment, Error>>
fn create( &self, auth_: &BearerToken, request: &CreateAttachmentRequest, ) -> impl Future<Output = Result<Attachment, Error>>
Create a new attachment. Assumes the file is already uploaded to S3 through the upload service.
Sourcefn get(
&self,
auth_: &BearerToken,
rid: &AttachmentRid,
) -> impl Future<Output = Result<Attachment, Error>>
fn get( &self, auth_: &BearerToken, rid: &AttachmentRid, ) -> impl Future<Output = Result<Attachment, Error>>
Get an attachment by its RID.
Sourcefn get_batch(
&self,
auth_: &BearerToken,
request: &GetAttachmentsRequest,
) -> impl Future<Output = Result<GetAttachmentsResponse, Error>>
fn get_batch( &self, auth_: &BearerToken, request: &GetAttachmentsRequest, ) -> impl Future<Output = Result<GetAttachmentsResponse, Error>>
Get a set of attachments by their RIDs.
Sourcefn get_content(
&self,
auth_: &BearerToken,
rid: &AttachmentRid,
) -> impl Future<Output = Result<I, Error>>
fn get_content( &self, auth_: &BearerToken, rid: &AttachmentRid, ) -> impl Future<Output = Result<I, Error>>
Get the binary content of an attachment.
Sourcefn get_uri(
&self,
auth_: &BearerToken,
rid: &AttachmentRid,
) -> impl Future<Output = Result<AttachmentUri, Error>>
fn get_uri( &self, auth_: &BearerToken, rid: &AttachmentRid, ) -> impl Future<Output = Result<AttachmentUri, Error>>
Get a pre-signed URI to download an attachment. The link expires in 1 minute.
Sourcefn update(
&self,
auth_: &BearerToken,
rid: &AttachmentRid,
request: &UpdateAttachmentRequest,
) -> impl Future<Output = Result<Attachment, Error>>
fn update( &self, auth_: &BearerToken, rid: &AttachmentRid, request: &UpdateAttachmentRequest, ) -> impl Future<Output = Result<Attachment, Error>>
Update an attachment. Only the fields that are set in the request will be updated.
Sourcefn archive(
&self,
auth_: &BearerToken,
rid: &AttachmentRid,
) -> impl Future<Output = Result<(), Error>>
fn archive( &self, auth_: &BearerToken, rid: &AttachmentRid, ) -> impl Future<Output = Result<(), Error>>
Archive an attachment.
Sourcefn unarchive(
&self,
auth_: &BearerToken,
rid: &AttachmentRid,
) -> impl Future<Output = Result<(), Error>>
fn unarchive( &self, auth_: &BearerToken, rid: &AttachmentRid, ) -> impl Future<Output = Result<(), Error>>
Unarchive an attachment.
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.