Struct ntex_h2::client::SimpleClient
source · 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
) -> Selfwhere
IoBoxed: From<T>,
pub fn new<T>( io: T, config: Config, scheme: Scheme, authority: ByteString ) -> Selfwhere IoBoxed: From<T>,
Construct new Client instance.
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 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 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 moresource§impl Debug for SimpleClient
impl Debug for SimpleClient
Auto Trait Implementations§
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