pub struct ParamsData {
pub download_limit: Option<u8>,
pub expiry_time: Option<usize>,
}Expand description
The parameters data object, that is sent to the server.
Fields§
§download_limit: Option<u8>The number of times this file may be downloaded. This value must be within a specific range, as enforced by Send servers.
expiry_time: Option<usize>The time in seconds after when the file expires. This value must be within a specific range, as enforced by Send servers. Only used with Send v3.
Implementations§
Source§impl ParamsData
impl ParamsData
Sourcepub fn from(download_limit: Option<u8>, expiry_time: Option<usize>) -> Self
pub fn from(download_limit: Option<u8>, expiry_time: Option<usize>) -> Self
Create a new parameters data object, with the given parameters.
Sourcepub fn set_download_limit(
&mut self,
download_limit: Option<u8>,
) -> Result<(), ParamsDataError>
pub fn set_download_limit( &mut self, download_limit: Option<u8>, ) -> Result<(), ParamsDataError>
Set the maximum number of allowed downloads, after which the file will be removed.
None may be given, to keep this parameter as is.
An error may be returned if the download value is out of the allowed
bound. These bounds are fixed and enforced by the server.
See PARAMS_DOWNLOAD_MIN and PARAMS_DOWNLOAD_MAX.
Sourcepub fn set_expiry_time(
&mut self,
expiry_time: Option<usize>,
) -> Result<(), ParamsDataError>
pub fn set_expiry_time( &mut self, expiry_time: Option<usize>, ) -> Result<(), ParamsDataError>
Set the expiry time in seconds for files.
None may be given, to keep this parameter as is.
An error may be returned if the expiry time value is out of the allowed bound. These bounds are fixed and enforced by the server.
Trait Implementations§
Source§impl Clone for ParamsData
impl Clone for ParamsData
Source§fn clone(&self) -> ParamsData
fn clone(&self) -> ParamsData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more