Struct jsonrpc::http::minreq_http::Builder
source · pub struct Builder { /* private fields */ }
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 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