Struct magic_wormhole::transfer::ReceiveRequest
source · [−]Expand description
Fields
filename: PathBufSecurity warning: this is untrusted and unverified input
filesize: u64Implementations
sourceimpl ReceiveRequest
impl ReceiveRequest
sourcepub async fn accept<F, G, W>(
self,
transit_handler: G,
progress_handler: F,
content_handler: &mut W,
cancel: impl Future<Output = ()>
) -> Result<(), TransferError> where
F: FnMut(u64, u64) + 'static,
G: FnOnce(TransitInfo, SocketAddr),
W: AsyncWrite + Unpin,
pub async fn accept<F, G, W>(
self,
transit_handler: G,
progress_handler: F,
content_handler: &mut W,
cancel: impl Future<Output = ()>
) -> Result<(), TransferError> where
F: FnMut(u64, u64) + 'static,
G: FnOnce(TransitInfo, SocketAddr),
W: AsyncWrite + Unpin,
Accept the file offer
This will transfer the file and save it on disk.
sourcepub async fn reject(self) -> Result<(), TransferError>
pub async fn reject(self) -> Result<(), TransferError>
Reject the file offer
This will send an error message to the other side so that it knows the transfer failed.
Auto Trait Implementations
impl !RefUnwindSafe for ReceiveRequest
impl Send for ReceiveRequest
impl Sync for ReceiveRequest
impl Unpin for ReceiveRequest
impl !UnwindSafe for ReceiveRequest
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more