pub struct CreateFromFile {
pub path: PathBuf,
pub content_location: Option<Url>,
pub content_type: String,
pub cache_in_ram: bool,
pub compute_md5: bool,
pub config: TransferConfig,
}Expand description
Typed builder for creating an ObjectDesc from a file.
§Example
use flute::sender::CreateFromFile;
let obj = CreateFromFile::builder()
.path(std::path::PathBuf::from("/tmp/test.bin"))
.content_type("application/octet-stream".to_string())
.build()
.create()
.unwrap();Fields§
§path: PathBufPath to the file
content_location: Option<Url>Supply the resource location for this object
content_type: StringMedia type of the object
cache_in_ram: boolIf true, the file is read and cached in RAM
compute_md5: boolIf true, compute and attach the MD5 hash
config: TransferConfigTransfer configuration (shared optional parameters)
Implementations§
Source§impl CreateFromFile
impl CreateFromFile
Sourcepub fn builder() -> CreateFromFileBuilder<((), (), (), (), (), ())>
pub fn builder() -> CreateFromFileBuilder<((), (), (), (), (), ())>
Create a builder for building CreateFromFile.
On the builder, call .path(...), .content_location(...)(optional), .content_type(...), .cache_in_ram(...)(optional), .compute_md5(...)(optional), .config(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of CreateFromFile.
Source§impl CreateFromFile
impl CreateFromFile
Sourcepub fn create(self) -> Result<Box<ObjectDesc>>
pub fn create(self) -> Result<Box<ObjectDesc>>
Create the ObjectDesc from the configured file parameters.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CreateFromFile
impl RefUnwindSafe for CreateFromFile
impl Send for CreateFromFile
impl Sync for CreateFromFile
impl Unpin for CreateFromFile
impl UnsafeUnpin for CreateFromFile
impl UnwindSafe for CreateFromFile
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