Struct ginmi::ClientBuilder
source · pub struct ClientBuilder<'a> { /* private fields */ }Implementations§
source§impl<'a> ClientBuilder<'a>
impl<'a> ClientBuilder<'a>
pub fn new(target: &'a str) -> Self
sourcepub fn credentials(self, username: &'a str, password: &'a str) -> Self
pub fn credentials(self, username: &'a str, password: &'a str) -> Self
Configure credentials to use for connecting to the target device.
sourcepub fn tls(
self,
ca_certificate: impl AsRef<[u8]>,
domain_name: impl Into<String>
) -> Self
pub fn tls( self, ca_certificate: impl AsRef<[u8]>, domain_name: impl Into<String> ) -> Self
Configure TLS to use for connecting to the target device.
sourcepub async fn build(self) -> Result<Client, GinmiError>
pub async fn build(self) -> Result<Client, GinmiError>
Consume the ClientBuilder and return a Client.
§Errors
- Returns
GinmiError::InvalidUriErrorif specified target is not a valid URI. - Returns
GinmiError::TransportErrorif the TLS-Settings are invalid. - Returns
GinmiError::TransportErrorif a connection to the target could not be established.
Trait Implementations§
source§impl<'a> Clone for ClientBuilder<'a>
impl<'a> Clone for ClientBuilder<'a>
source§fn clone(&self) -> ClientBuilder<'a>
fn clone(&self) -> ClientBuilder<'a>
Returns a copy of the value. Read more
1.0.0 · 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<'a> RefUnwindSafe for ClientBuilder<'a>
impl<'a> Send for ClientBuilder<'a>
impl<'a> Sync for ClientBuilder<'a>
impl<'a> Unpin for ClientBuilder<'a>
impl<'a> UnwindSafe for ClientBuilder<'a>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request