pub struct ReqwestClientBuilder { /* private fields */ }Available on crate feature
did-web and crate feature local-network and (crate features did-jwk or did-key or did-web) only.Expand description
Builds a ReqwestClient that may also reach the local network, for development and
tests; see Local development and tests.
§Examples
use identity_kit::methods::web::ReqwestClient;
let client = ReqwestClient::builder().dangerous_allow_loopback().build()?;
assert!(client.local_network().loopback && !client.local_network().private);Implementations§
Source§impl ReqwestClientBuilder
impl ReqwestClientBuilder
Sourcepub const fn dangerous_allow_loopback(self) -> Self
pub const fn dangerous_allow_loopback(self) -> Self
Lets the client reach 127.0.0.0/8 and ::1 over plain http. For development
and tests only.
Sourcepub const fn dangerous_allow_private_network(self) -> Self
pub const fn dangerous_allow_private_network(self) -> Self
Lets the client reach RFC 1918 addresses and fc00::/7 over plain http. For
development and tests only.
Sourcepub fn build(self) -> Result<ReqwestClient, HttpError>
pub fn build(self) -> Result<ReqwestClient, HttpError>
The client: ReqwestClient::new plus the local ranges allowed here.
§Errors
HttpError when the TLS backend cannot be initialized.
Trait Implementations§
Source§impl Clone for ReqwestClientBuilder
impl Clone for ReqwestClientBuilder
Auto Trait Implementations§
impl Freeze for ReqwestClientBuilder
impl RefUnwindSafe for ReqwestClientBuilder
impl Send for ReqwestClientBuilder
impl Sync for ReqwestClientBuilder
impl Unpin for ReqwestClientBuilder
impl UnsafeUnpin for ReqwestClientBuilder
impl UnwindSafe for ReqwestClientBuilder
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