pub struct SimpleClient(/* private fields */);
Expand description
Http2 client
Implementations§
Source§impl SimpleClient
impl SimpleClient
Sourcepub fn new<T>(
io: T,
config: Config,
scheme: Scheme,
authority: ByteString,
) -> Self
pub fn new<T>( io: T, config: Config, scheme: Scheme, authority: ByteString, ) -> Self
Construct new Client
instance.
Sourcepub fn id(&self) -> &ByteString
pub fn id(&self) -> &ByteString
Get client id
Sourcepub async fn send(
&self,
method: Method,
path: ByteString,
headers: HeaderMap,
eof: bool,
) -> Result<(SendStream, RecvStream), OperationError>
pub async fn send( &self, method: Method, path: ByteString, headers: HeaderMap, eof: bool, ) -> Result<(SendStream, RecvStream), OperationError>
Send request to the peer
Sourcepub fn is_ready(&self) -> bool
pub fn is_ready(&self) -> bool
Check if client is allowed to send new request
Readiness depends on number of opened streams and max concurrency setting
Sourcepub async fn ready(&self) -> Result<(), OperationError>
pub async fn ready(&self) -> Result<(), OperationError>
Check client readiness
Client is ready when it is possible to start new stream
Sourcepub fn force_close(&self)
pub fn force_close(&self)
Close connection
Sourcepub fn disconnect(&self) -> ClientDisconnect
pub fn disconnect(&self) -> ClientDisconnect
Gracefully disconnect connection
Connection force closes if ClientDisconnect
get dropped
Sourcepub fn is_disconnecting(&self) -> bool
pub fn is_disconnecting(&self) -> bool
Check if connection is disconnecting
Sourcepub fn on_disconnect(&self) -> OnDisconnect
pub fn on_disconnect(&self) -> OnDisconnect
Notify when connection get closed
Client’s authority
Sourcepub fn max_streams(&self) -> Option<u32>
pub fn max_streams(&self) -> Option<u32>
Get max number of active streams
Sourcepub fn active_streams(&self) -> u32
pub fn active_streams(&self) -> u32
Get number of active streams
Trait Implementations§
Source§impl Clone for SimpleClient
impl Clone for SimpleClient
Source§fn clone(&self) -> SimpleClient
fn clone(&self) -> SimpleClient
Returns a duplicate 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 moreSource§impl Debug for SimpleClient
impl Debug for SimpleClient
Auto Trait Implementations§
impl Freeze for SimpleClient
impl !RefUnwindSafe for SimpleClient
impl !Send for SimpleClient
impl !Sync for SimpleClient
impl Unpin for SimpleClient
impl !UnwindSafe for SimpleClient
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