pub struct ConnectClient { /* private fields */ }Expand description
Minimal h2c Connect client.
Implementations§
Source§impl ConnectClient
impl ConnectClient
Sourcepub fn new(endpoint: impl Into<String>, bearer: Option<String>) -> Self
pub fn new(endpoint: impl Into<String>, bearer: Option<String>) -> Self
Create a client for an HTTP endpoint.
Sourcepub async fn unary<Req, Resp>(
&self,
path: &str,
request: &Req,
) -> Result<Resp, ConnectClientError>
pub async fn unary<Req, Resp>( &self, path: &str, request: &Req, ) -> Result<Resp, ConnectClientError>
Execute a unary Connect request.
§Errors
Returns an error when the endpoint, connection, HTTP exchange, or protobuf encoding/decoding fails, or when Connect returns an error.
Sourcepub async fn streaming<Req, Resp>(
&self,
path: &str,
request: &Req,
) -> Result<Receiver<Result<Resp, ConnectClientError>>, ConnectClientError>
pub async fn streaming<Req, Resp>( &self, path: &str, request: &Req, ) -> Result<Receiver<Result<Resp, ConnectClientError>>, ConnectClientError>
Execute a Connect client-streaming/server-streaming request with one start message.
§Errors
Returns an error when the endpoint, connection, HTTP exchange, or protobuf encoding fails, or when Connect rejects the stream.
Trait Implementations§
Source§impl Clone for ConnectClient
impl Clone for ConnectClient
Source§fn clone(&self) -> ConnectClient
fn clone(&self) -> ConnectClient
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 Freeze for ConnectClient
impl RefUnwindSafe for ConnectClient
impl Send for ConnectClient
impl Sync for ConnectClient
impl Unpin for ConnectClient
impl UnsafeUnpin for ConnectClient
impl UnwindSafe for ConnectClient
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