[−][src]Struct ffsend_api::action::params::ParamsData
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
impl ParamsData
[src]
pub fn new() -> Self
[src]
Construct a new parameters object, that is empty.
pub fn from(download_limit: Option<u8>, expiry_time: Option<usize>) -> Self
[src]
Create a new parameters data object, with the given parameters.
pub fn set_download_limit(
&mut self,
download_limit: Option<u8>
) -> Result<(), ParamsDataError>
[src]
&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
.
pub fn set_expiry_time(
&mut self,
expiry_time: Option<usize>
) -> Result<(), ParamsDataError>
[src]
&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.
pub fn is_empty(&self) -> bool
[src]
Check whether this parameters object is empty, and wouldn't change any parameter on the server when sent. Sending an empty parameter data object would thus be useless.
pub fn normalize(&mut self, version: Version)
[src]
Normalize this data for the given version.
For example, Send v2 does not support the expiry time field. If normalizing for this version this field is dropped from the struct.
Trait Implementations
impl Clone for ParamsData
[src]
fn clone(&self) -> ParamsData
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ParamsData
[src]
impl Default for ParamsData
[src]
fn default() -> ParamsData
[src]
impl Serialize for ParamsData
[src]
Auto Trait Implementations
impl RefUnwindSafe for ParamsData
impl Send for ParamsData
impl Sync for ParamsData
impl Unpin for ParamsData
impl UnwindSafe for ParamsData
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Sealed<T> for T where
T: ?Sized,
T: ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Typeable for T where
T: Any,
T: Any,