Struct ffsend_api::file::remote_file::RemoteFile[][src]

pub struct RemoteFile { /* fields omitted */ }

A struct representing an uploaded file on a Send host.

The struct contains the file ID, the file URL, the key that is required in combination with the file, and the owner key.

Methods

impl RemoteFile
[src]

Construct a new file.

Construct a new file, that was created at this exact time. This will set the file expiration time

Try to parse the given share URL.

The given URL is matched against a share URL pattern, this does not check whether the host is a valid and online host.

If the URL fragmet contains a file secret, it is also parsed. If it does not, the secret is left empty and must be specified manually.

An optional owner token may be given.

Get the file ID.

Get the time the file will expire after. Note that this time may not be correct as it may have been guessed, see expire_uncertain().

Get the duration the file will expire after. Note that this time may not be correct as it may have been guessed, see expire_uncertain().

Set the time this file will expire at. None may be given to assign the default expiry time with the uncertainty flag set.

Set the time this file will expire at, based on the given duration from now.

Check whether this file has expired, based on it's expiry property.

Check whehter the set expiry time is uncertain. If the expiry time of a file is unknown, the default time is assigned from the first time the file was used. Such time will be uncertain as it probably isn't correct. This time may be used however to check for expiry.

Get the file URL, provided by the server.

Important traits for Vec<u8>

Get the raw secret.

Get the secret as base64 encoded string.

Set the secret for this file.

Check whether a file secret is set. This secret must be set to decrypt a downloaded Send file.

Get the owner token if set.

Get the owner token if set.

Set the owner token, wrapped in an option. If None is given, the owner token will be unset.

Check whether an owner token is set in this remote file.

Get the host URL for this remote file.

Build the download URL of the given file. This URL is identical to the share URL, a term used in this API. Set secret to true, to include it in the URL if known.

Merge properties non-existant into this file, from the given other file. This is ofcourse only done for properties that may be empty.

The file IDs are not asserted for equality.

Trait Implementations

impl Clone for RemoteFile
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for RemoteFile
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for RemoteFile

impl Sync for RemoteFile