pub struct StoreMediaParams {
pub filename: String,
pub data: Option<String>,
pub url: Option<String>,
pub path: Option<String>,
pub delete_existing: Option<bool>,
}Expand description
Parameters for storing a media file.
Fields§
§filename: StringFilename to save as.
data: Option<String>Base64-encoded file data.
url: Option<String>URL to download from.
path: Option<String>Local file path.
delete_existing: Option<bool>Delete existing file with same name.
Implementations§
Source§impl StoreMediaParams
impl StoreMediaParams
Sourcepub fn from_base64(
filename: impl Into<String>,
data: impl Into<String>,
) -> StoreMediaParams
pub fn from_base64( filename: impl Into<String>, data: impl Into<String>, ) -> StoreMediaParams
Create params for storing base64-encoded data.
Sourcepub fn from_url(
filename: impl Into<String>,
url: impl Into<String>,
) -> StoreMediaParams
pub fn from_url( filename: impl Into<String>, url: impl Into<String>, ) -> StoreMediaParams
Create params for storing from a URL.
Sourcepub fn from_path(
filename: impl Into<String>,
path: impl Into<String>,
) -> StoreMediaParams
pub fn from_path( filename: impl Into<String>, path: impl Into<String>, ) -> StoreMediaParams
Create params for storing from a local file path.
Sourcepub fn delete_existing(self, delete: bool) -> StoreMediaParams
pub fn delete_existing(self, delete: bool) -> StoreMediaParams
Set whether to delete existing file with same name.
Trait Implementations§
Source§impl Clone for StoreMediaParams
impl Clone for StoreMediaParams
Source§fn clone(&self) -> StoreMediaParams
fn clone(&self) -> StoreMediaParams
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StoreMediaParams
impl Debug for StoreMediaParams
Source§impl Serialize for StoreMediaParams
impl Serialize for StoreMediaParams
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for StoreMediaParams
impl RefUnwindSafe for StoreMediaParams
impl Send for StoreMediaParams
impl Sync for StoreMediaParams
impl Unpin for StoreMediaParams
impl UnwindSafe for StoreMediaParams
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