Trait ReserveBiStreams
pub trait ReserveBiStreams: Connection {
type Reservation: BiReservation<SendStream = Self::SendStream, RecvStream = Self::RecvStream>;
// Required methods
fn try_reserve_bi(
&self,
) -> Result<Option<Self::Reservation>, ConnectionError>;
fn subscribe_bi_stream_budget(&self, listener: Weak<dyn ChangeListener>);
}Available on crate features
http-backend and http and std only.Expand description
Exact stream credit for a multiplexing connection pool, see
SendRequest::connection_admission.
Required Associated Types§
type Reservation: BiReservation<SendStream = Self::SendStream, RecvStream = Self::RecvStream>
Required Methods§
fn try_reserve_bi(&self) -> Result<Option<Self::Reservation>, ConnectionError>
fn try_reserve_bi(&self) -> Result<Option<Self::Reservation>, ConnectionError>
None before the handshake completes or while credit is exhausted.
fn subscribe_bi_stream_budget(&self, listener: Weak<dyn ChangeListener>)
fn subscribe_bi_stream_budget(&self, listener: Weak<dyn ChangeListener>)
Notify listener when locally initiated bidirectional stream credit becomes available,
the handshake completes, or the connection closes, until the listener is dropped.
Acquiring or consuming a reservation need not notify listeners. Subscribe before trying
to reserve credit to avoid missing a notification.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".