pub(super) async fn create_attachment<E: CreateAttachmentFailure>(
api_client: &ApiClient,
cipher_id: CipherId,
request: CreateAttachmentRequest,
as_admin: bool,
into_cipher: impl AsyncFnOnce(AttachmentUploadDataResponseModel) -> Result<Cipher, E>,
) -> Result<CreatedAttachment, E>Expand description
Opens an attachment slot, then hands the server response to into_cipher to produce the
returned cipher. If anything after slot creation fails, the slot is deleted best-effort
through the endpoint matching as_admin.