pub struct AttachmentReceiver { /* private fields */ }Expand description
Manages attachment uploads
Implementations§
Source§impl AttachmentReceiver
impl AttachmentReceiver
Sourcepub async fn start_upload(
&self,
command_id: String,
agent_id: String,
attachment_id: String,
filename: String,
mime_type: String,
size: u64,
compressed: bool,
compression_algorithm: Option<CompressionAlgorithm>,
chunks_total: u32,
) -> Result<()>
pub async fn start_upload( &self, command_id: String, agent_id: String, attachment_id: String, filename: String, mime_type: String, size: u64, compressed: bool, compression_algorithm: Option<CompressionAlgorithm>, chunks_total: u32, ) -> Result<()>
Start receiving a new attachment
Sourcepub async fn receive_chunk(
&self,
attachment_id: &str,
chunk_index: u32,
data: &str,
is_final: bool,
) -> Result<bool>
pub async fn receive_chunk( &self, attachment_id: &str, chunk_index: u32, data: &str, is_final: bool, ) -> Result<bool>
Receive a chunk of attachment data
Sourcepub async fn complete_upload(
&self,
attachment_id: &str,
expected_checksum: &str,
) -> Result<PathBuf>
pub async fn complete_upload( &self, attachment_id: &str, expected_checksum: &str, ) -> Result<PathBuf>
Complete the attachment upload, verify checksum, and save to disk
Sourcepub async fn cancel_upload(&self, attachment_id: &str)
pub async fn cancel_upload(&self, attachment_id: &str)
Cancel a pending upload
Trait Implementations§
Source§impl Clone for AttachmentReceiver
impl Clone for AttachmentReceiver
Source§fn clone(&self) -> AttachmentReceiver
fn clone(&self) -> AttachmentReceiver
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AttachmentReceiver
impl !RefUnwindSafe for AttachmentReceiver
impl Send for AttachmentReceiver
impl Sync for AttachmentReceiver
impl Unpin for AttachmentReceiver
impl UnsafeUnpin for AttachmentReceiver
impl !UnwindSafe for AttachmentReceiver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more