Struct EasyBuilder

Source
pub struct EasyBuilder { /* private fields */ }
Expand description

The builder struct for curl::easy::Easy handler.

See the API document of curl-rust for detailed descriptions that Easy API provides.

All errors occured during building operations will be stored in a internal Vec, and exposed at finalization, which is when the builder’s build() method is called.

Implementations§

Source§

impl EasyBuilder

Source

pub fn new() -> EasyBuilder

Creates a builder.

§Examples
use curl_easybuilder::EasyBuilder;

let easy = EasyBuilder::new();
Source

pub fn verbose(&mut self, verbose: bool) -> &mut EasyBuilder

Source

pub fn show_header(&mut self, show: bool) -> &mut EasyBuilder

Source

pub fn progress(&mut self, progress: bool) -> &mut EasyBuilder

Source

pub fn signal(&mut self, signal: bool) -> &mut EasyBuilder

Source

pub fn wildcard_match(&mut self, m: bool) -> &mut EasyBuilder

Source

pub fn fail_on_error(&mut self, fail: bool) -> &mut EasyBuilder

Source

pub fn url(&mut self, url: &str) -> &mut EasyBuilder

Source

pub fn port(&mut self, port: u16) -> &mut EasyBuilder

Source

pub fn proxy(&mut self, url: &str) -> &mut EasyBuilder

Source

pub fn proxy_port(&mut self, port: u16) -> &mut EasyBuilder

Source

pub fn proxy_type(&mut self, kind: ProxyType) -> &mut EasyBuilder

Source

pub fn noproxy(&mut self, skip: &str) -> &mut EasyBuilder

Source

pub fn http_proxy_tunnel(&mut self, tunnel: bool) -> &mut EasyBuilder

Source

pub fn interface(&mut self, interface: &str) -> &mut EasyBuilder

Source

pub fn set_local_port(&mut self, port: u16) -> &mut EasyBuilder

Source

pub fn local_port_range(&mut self, range: u16) -> &mut EasyBuilder

Source

pub fn dns_cache_timeout(&mut self, dur: Duration) -> &mut EasyBuilder

Source

pub fn buffer_size(&mut self, size: usize) -> &mut EasyBuilder

Source

pub fn tcp_nodelay(&mut self, enable: bool) -> &mut EasyBuilder

Source

pub fn address_scope(&mut self, scope: u32) -> &mut EasyBuilder

Source

pub fn username(&mut self, user: &str) -> &mut EasyBuilder

Source

pub fn password(&mut self, pass: &str) -> &mut EasyBuilder

Source

pub fn proxy_username(&mut self, user: &str) -> &mut EasyBuilder

Source

pub fn proxy_password(&mut self, pass: &str) -> &mut EasyBuilder

Source

pub fn autoreferer(&mut self, enable: bool) -> &mut EasyBuilder

Source

pub fn accept_encoding(&mut self, encoding: &str) -> &mut EasyBuilder

Source

pub fn transfer_encoding(&mut self, enable: bool) -> &mut EasyBuilder

Source

pub fn follow_location(&mut self, enable: bool) -> &mut EasyBuilder

Source

pub fn unrestricted_auth(&mut self, enable: bool) -> &mut EasyBuilder

Source

pub fn max_redirections(&mut self, max: u32) -> &mut EasyBuilder

Source

pub fn put(&mut self, enable: bool) -> &mut EasyBuilder

Source

pub fn post(&mut self, enable: bool) -> &mut EasyBuilder

Source

pub fn post_fields_copy(&mut self, data: &[u8]) -> &mut EasyBuilder

Source

pub fn post_field_size(&mut self, size: u64) -> &mut EasyBuilder

Source

pub fn referer(&mut self, referer: &str) -> &mut EasyBuilder

Source

pub fn useragent(&mut self, useragent: &str) -> &mut EasyBuilder

Source

pub fn http_headers(&mut self, list: List) -> &mut EasyBuilder

Source

pub fn cookie(&mut self, cookie: &str) -> &mut EasyBuilder

Source

pub fn cookie_file<P: AsRef<Path>>(&mut self, file: P) -> &mut EasyBuilder

Source

pub fn cookie_jar<P: AsRef<Path>>(&mut self, file: P) -> &mut EasyBuilder

Source

pub fn cookie_session(&mut self, session: bool) -> &mut EasyBuilder

Source

pub fn cookie_list(&mut self, cookie: &str) -> &mut EasyBuilder

Source

pub fn get(&mut self, enable: bool) -> &mut EasyBuilder

Source

pub fn ignore_content_length(&mut self, ignore: bool) -> &mut EasyBuilder

Source

pub fn http_content_decoding(&mut self, enable: bool) -> &mut EasyBuilder

Source

pub fn http_transfer_decoding(&mut self, enable: bool) -> &mut EasyBuilder

Source

pub fn range(&mut self, range: &str) -> &mut EasyBuilder

Source

pub fn resume_from(&mut self, from: u64) -> &mut EasyBuilder

Source

pub fn custom_request(&mut self, request: &str) -> &mut EasyBuilder

Source

pub fn fetch_filetime(&mut self, fetch: bool) -> &mut EasyBuilder

Source

pub fn nobody(&mut self, enable: bool) -> &mut EasyBuilder

Source

pub fn in_filesize(&mut self, size: u64) -> &mut EasyBuilder

Source

pub fn upload(&mut self, enable: bool) -> &mut EasyBuilder

Source

pub fn max_filesize(&mut self, size: u64) -> &mut EasyBuilder

Source

pub fn time_condition(&mut self, cond: TimeCondition) -> &mut EasyBuilder

Source

pub fn time_value(&mut self, val: i64) -> &mut EasyBuilder

Source

pub fn timeout(&mut self, timeout: Duration) -> &mut EasyBuilder

Source

pub fn low_speed_limit(&mut self, limit: u32) -> &mut EasyBuilder

Source

pub fn low_speed_time(&mut self, dur: Duration) -> &mut EasyBuilder

Source

pub fn max_send_speed(&mut self, speed: u64) -> &mut EasyBuilder

Source

pub fn max_recv_speed(&mut self, speed: u64) -> &mut EasyBuilder

Source

pub fn max_connects(&mut self, max: u32) -> &mut EasyBuilder

Source

pub fn fresh_connect(&mut self, enable: bool) -> &mut EasyBuilder

Source

pub fn forbid_reuse(&mut self, enable: bool) -> &mut EasyBuilder

Source

pub fn connect_timeout(&mut self, timeout: Duration) -> &mut EasyBuilder

Source

pub fn ip_resolve(&mut self, resolve: IpResolve) -> &mut EasyBuilder

Source

pub fn connect_only(&mut self, enable: bool) -> &mut EasyBuilder

Source

pub fn ssl_cert<P: AsRef<Path>>(&mut self, cert: P) -> &mut EasyBuilder

Source

pub fn ssl_cert_type(&mut self, kind: &str) -> &mut EasyBuilder

Source

pub fn ssl_key<P: AsRef<Path>>(&mut self, key: P) -> &mut EasyBuilder

Source

pub fn ssl_key_type(&mut self, kind: &str) -> &mut EasyBuilder

Source

pub fn key_password(&mut self, password: &str) -> &mut EasyBuilder

Source

pub fn ssl_engine(&mut self, engine: &str) -> &mut EasyBuilder

Source

pub fn ssl_engine_default(&mut self, enable: bool) -> &mut EasyBuilder

Source

pub fn ssl_version(&mut self, version: SslVersion) -> &mut EasyBuilder

Source

pub fn ssl_verify_host(&mut self, verify: bool) -> &mut EasyBuilder

Source

pub fn ssl_verify_peer(&mut self, verify: bool) -> &mut EasyBuilder

Source

pub fn cainfo<P: AsRef<Path>>(&mut self, path: P) -> &mut EasyBuilder

Source

pub fn issuer_cert<P: AsRef<Path>>(&mut self, path: P) -> &mut EasyBuilder

Source

pub fn capath<P: AsRef<Path>>(&mut self, path: P) -> &mut EasyBuilder

Source

pub fn crlfile<P: AsRef<Path>>(&mut self, path: P) -> &mut EasyBuilder

Source

pub fn certinfo(&mut self, enable: bool) -> &mut EasyBuilder

Source

pub fn random_file<P: AsRef<Path>>(&mut self, p: P) -> &mut EasyBuilder

Source

pub fn egd_socket<P: AsRef<Path>>(&mut self, p: P) -> &mut EasyBuilder

Source

pub fn ssl_cipher_list(&mut self, ciphers: &str) -> &mut EasyBuilder

Source

pub fn ssl_sessionid_cache(&mut self, enable: bool) -> &mut EasyBuilder

Source

pub fn write_function<F>(&mut self, f: F) -> &mut EasyBuilder
where F: FnMut(&[u8]) -> Result<usize, WriteError> + Send + 'static,

Source

pub fn read_function<F>(&mut self, f: F) -> &mut EasyBuilder
where F: FnMut(&mut [u8]) -> Result<usize, ReadError> + Send + 'static,

Source

pub fn has_errors(&self) -> bool

Tests if the builder stores any curl::Error happend during this build.

Source

pub fn result(&mut self) -> BuildResult<&mut Easy>

Finalize the builder and returns mutable reference of Easy wrapped inside a Result.

§Examples
use curl_easybuilder::EasyBuilder;

let mut b = EasyBuilder::new();
assert!(b.result().is_ok());

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.