pub struct TransferRequest { /* private fields */ }Expand description
A set of virtual files and a cancellation token for one transfer.
Create a request when you need access to its cancellation token before
starting a blocking drag operation. Functions accepting
Into<TransferRequest> can also take a Vec<VirtualFile> directly.
Implementations§
Source§impl TransferRequest
impl TransferRequest
Sourcepub fn new(files: Vec<VirtualFile>) -> Self
pub fn new(files: Vec<VirtualFile>) -> Self
Creates a transfer request containing the supplied virtual files.
The request starts with a new, non-cancelled token. File names and transfer-level conflicts are validated when the transfer data object is created, not by this constructor.
Sourcepub fn cancellation_token(&self) -> CancellationToken
pub fn cancellation_token(&self) -> CancellationToken
Returns a clone of the request’s shared cancellation token.
Keep the token to request cancellation while a blocking drag operation is running, for example from another thread or UI callback.
Trait Implementations§
Source§impl From<Vec<VirtualFile>> for TransferRequest
impl From<Vec<VirtualFile>> for TransferRequest
Source§fn from(files: Vec<VirtualFile>) -> Self
fn from(files: Vec<VirtualFile>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for TransferRequest
impl !UnwindSafe for TransferRequest
impl Freeze for TransferRequest
impl Send for TransferRequest
impl Sync for TransferRequest
impl Unpin for TransferRequest
impl UnsafeUnpin for TransferRequest
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