pub struct ClientConfig { /* private fields */ }
Expand description
Configurable properties for networking client used for ffsend actions.
Implementations§
Source§impl ClientConfig
impl ClientConfig
Sourcepub fn client(self, transfer: bool) -> Client
pub fn client(self, transfer: bool) -> Client
Construct a ffsend client based on this configuration.
If this client is used for transfering files, transfer
should be true.
Examples found in repository?
examples/upload.rs (line 21)
18fn upload_file(path: PathBuf) -> Result<RemoteFile, Error> {
19 // Build the client for uploading
20 let client_config = ClientConfigBuilder::default().build().unwrap();
21 let client = client_config.client(true);
22
23 #[cfg(feature = "send3")]
24 let version = Version::V3;
25 #[cfg(not(feature = "send3"))]
26 let version = Version::V2;
27
28 // Build upload action, and invoke to upload
29 let upload = Upload::new(
30 version,
31 Url::parse("https://send.firefox.com/").unwrap(),
32 path,
33 None,
34 None,
35 None,
36 );
37 Upload::invoke(upload, &client, None)
38}
Trait Implementations§
Source§impl Clone for ClientConfig
impl Clone for ClientConfig
Source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
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 ClientConfig
impl Debug for ClientConfig
Auto Trait Implementations§
impl Freeze for ClientConfig
impl RefUnwindSafe for ClientConfig
impl Send for ClientConfig
impl Sync for ClientConfig
impl Unpin for ClientConfig
impl UnwindSafe for ClientConfig
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