pub struct OcpiClient { /* private fields */ }Available on crate feature
client only.Expand description
The entry point: an HTTP client plus the configuration every request uses.
Implementations§
Source§impl OcpiClient
impl OcpiClient
Sourcepub fn new() -> Result<Self, Error>
pub fn new() -> Result<Self, Error>
A client with the default configuration.
§Errors
Returns the reqwest error if the HTTP client cannot be built, which happens when the
platform has no usable TLS backend.
Sourcepub fn with_config(config: ClientConfig) -> Result<Self, Error>
pub fn with_config(config: ClientConfig) -> Result<Self, Error>
Sourcepub fn from_http(http: Client, config: ClientConfig) -> Self
pub fn from_http(http: Client, config: ClientConfig) -> Self
A client over an existing reqwest client, for sharing a connection pool.
Sourcepub const fn transport(&self) -> &Transport
pub const fn transport(&self) -> &Transport
The request executor, which the handshake and the module clients take.
Sourcepub const fn config(&self) -> &ClientConfig
pub const fn config(&self) -> &ClientConfig
The configuration in use.
Trait Implementations§
Source§impl Clone for OcpiClient
impl Clone for OcpiClient
Source§fn clone(&self) -> OcpiClient
fn clone(&self) -> OcpiClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for OcpiClient
impl !UnwindSafe for OcpiClient
impl Freeze for OcpiClient
impl Send for OcpiClient
impl Sync for OcpiClient
impl Unpin for OcpiClient
impl UnsafeUnpin for OcpiClient
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