logo
pub struct FileTransferProxy<'a>(_);
Expand description

The interface operates as a middle-man between apps when transferring files via drag-and-drop or copy-paste, taking care of the necessary exporting of files in the document portal.

Toolkits are expected to use the application/vnd.portal.filetransfer mimetype when using this mechanism for file exchange via copy-paste or drag-and-drop.

The data that is transmitted with this mimetype should be the key returned by the StartTransfer method. Upon receiving this mimetype, the target should call RetrieveFiles with the key, to obtain the list of files. The portal will take care of exporting files in the document store as necessary to make them accessible to the target.

Wrapper of the DBus interface: org.freedesktop.portal.FileTransfer.

Implementations

Create a new instance of FileTransferProxy.

Get a reference to the underlying Proxy.

Adds files to a session. This method can be called multiple times on a given session. Note only regular files (not directories) can be added.

Arguments
  • key - A key returned by start_transfer().
  • fds - A list of file descriptors of the files to register.
Specifications

See also AddFiles.

Retrieves files that were previously added to the session with add_files(). The files will be exported in the document portal as-needed for the caller, and they will be writable if the owner of the session allowed it.

Arguments
Returns

The list of file paths.

Specifications

See also RetrieveFiles.

Starts a session for a file transfer. The caller should call add_files() at least once, to add files to this session.

Arguments
  • writeable - Sets whether the chosen application can write to the files or not.
  • auto_stop - Whether to stop the transfer automatically after the first retrieve_files() call.
Returns

Key that can be passed to retrieve_files() to obtain the files.

Specifications

See also StartTransfer.

Ends the transfer. Further calls to add_files() or retrieve_files() for this key will return an error.

Arguments
Specifications

See also StopTransfer.

Emitted when the transfer is closed.

Returns
Specifications

See also TransferClosed.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.