pub struct Builder { /* private fields */ }
Available on crate feature
minreq_http
only.Expand description
Builder for simple bitcoind MinreqHttpTransport
.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn new() -> Builder
pub fn new() -> Builder
Constructs a new Builder
with default configuration and the URL to use.
Sourcepub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Sets the timeout after which requests will abort if they aren’t finished.
Sourcepub fn url(self, url: &str) -> Result<Self, Error>
pub fn url(self, url: &str) -> Result<Self, Error>
Sets the URL of the server to the transport.
Sourcepub fn basic_auth(self, user: String, pass: Option<String>) -> Self
pub fn basic_auth(self, user: String, pass: Option<String>) -> Self
Adds authentication information to the transport.
Adds authentication information to the transport using a cookie string (‘user:pass’).
Does no checking on the format of the cookie string, just base64 encodes whatever is passed in.
§Examples
let mut file = File::open(cookie_file).expect("couldn't open cookie file");
let mut cookie = String::new();
fs::read_to_string(&mut cookie).expect("couldn't read cookie file");
let client = MinreqHttpTransport::builder().cookie_auth(cookie);
Sourcepub fn build(self) -> MinreqHttpTransport
pub fn build(self) -> MinreqHttpTransport
Builds the final MinreqHttpTransport
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Builder
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
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