pub struct TransferInfoBuilder(/* private fields */);
Expand description
Builder for TransferInfo
Implementations§
Source§impl TransferInfoBuilder
impl TransferInfoBuilder
Sourcepub fn new() -> TransferInfoBuilder
pub fn new() -> TransferInfoBuilder
Builder pattern for TransferInfo
use std::path::Path;
use std::error::Error;
use portal_lib::TransferInfoBuilder;
fn some_method() -> Result<(), Box<dyn Error>> {
// Use the builder to create a TransferInfo object
let mut info = TransferInfoBuilder::new()
.add_file(Path::new("/etc/passwd"))?
.finalize();
// ... Pass it to methods that require it ...
Ok(())
}
pub fn add_file( self, path: &Path, ) -> Result<TransferInfoBuilder, Box<dyn Error>>
Sourcepub fn finalize(self) -> TransferInfo
pub fn finalize(self) -> TransferInfo
Finalize the builder into a TransferInfo object
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TransferInfoBuilder
impl RefUnwindSafe for TransferInfoBuilder
impl Send for TransferInfoBuilder
impl Sync for TransferInfoBuilder
impl Unpin for TransferInfoBuilder
impl UnwindSafe for TransferInfoBuilder
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