pub trait ConduitTx {
type Msg: MsgFamily;
type Permit<'a>: for<'m> ConduitTxPermit<Msg = Self::Msg> + MaybeSend
where Self: 'a;
// Required methods
fn reserve(
&self,
) -> impl Future<Output = Result<Self::Permit<'_>>> + MaybeSend + '_;
async fn close(self) -> Result<()>
where Self: Sized;
}Expand description
Sending half of a Conduit.
Permit-based: reserve() is the backpressure point, permit.send()
serializes and writes.
Required Associated Types§
type Msg: MsgFamily
type Permit<'a>: for<'m> ConduitTxPermit<Msg = Self::Msg> + MaybeSend where Self: 'a
Required Methods§
Sourcefn reserve(
&self,
) -> impl Future<Output = Result<Self::Permit<'_>>> + MaybeSend + '_
fn reserve( &self, ) -> impl Future<Output = Result<Self::Permit<'_>>> + MaybeSend + '_
Reserve capacity for one outbound message.
Backpressure lives here — this may block waiting for:
- StableConduit: replay buffer capacity (bounded outstanding)
- Flow control from the peer
Dropping the permit without sending releases the reservation.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.