pub struct Sender(/* private fields */);Expand description
The capability to publish one endpoint’s outbound flow.
Implementations§
Source§impl Sender
impl Sender
pub fn id(&self) -> ExchangeId
pub fn flow(&self) -> Flow
Sourcepub fn chunk_geometry(&self) -> ChunkGeometry
pub fn chunk_geometry(&self) -> ChunkGeometry
Effective chunk geometry, including this direction’s credit limit.
Sourcepub fn plan_chunks(&self, data_bytes: usize) -> Result<ChunkPlan>
pub fn plan_chunks(&self, data_bytes: usize) -> Result<ChunkPlan>
Plan a known payload using the default chunk target.
Sourcepub fn plan_chunks_with(
&self,
data_bytes: usize,
slots_per_chunk: usize,
) -> Result<ChunkPlan>
pub fn plan_chunks_with( &self, data_bytes: usize, slots_per_chunk: usize, ) -> Result<ChunkPlan>
Plan a known payload with a runtime-selected number of slots per chunk.
pub fn start(&mut self, metadata: Option<&[u8]>) -> Result<()>
Sourcepub fn reserve_start(&mut self, payload_len: usize) -> Result<PendingStart<'_>>
pub fn reserve_start(&mut self, payload_len: usize) -> Result<PendingStart<'_>>
Reserve start metadata directly in the shared payload arena. No start event is visible until the returned guard is committed.
pub fn data(&mut self, payload: &[u8]) -> Result<ChunkDescriptor>
Sourcepub fn reserve_data(&mut self, payload_len: usize) -> Result<PendingData<'_>>
pub fn reserve_data(&mut self, payload_len: usize) -> Result<PendingData<'_>>
Reserve one variable-sized data chunk directly in the payload arena. One commit emits one data descriptor.
pub fn finish(&mut self) -> Result<()>
Sourcepub fn finish_empty(&mut self) -> Result<()>
pub fn finish_empty(&mut self) -> Result<()>
Close an unused direction. The application already knows from its metadata that there is nothing to receive from this direction.
pub fn reset(&mut self, code: ResetCode) -> Result<()>
Sourcepub async fn peer_closed(&mut self) -> Result<()>
pub async fn peer_closed(&mut self) -> Result<()>
Observe cancellation while waiting on application work instead of a control write or a payload reservation. Clean FIN is not cancellation.
pub fn wait_writable(&self) -> Result<()>
pub fn poll_writable(&self, cx: &mut Context<'_>) -> Poll<Result<()>>
Sourcepub fn wait_ready(&self, payload_len: usize) -> Result<()>
pub fn wait_ready(&self, payload_len: usize) -> Result<()>
Wait for one control frame and any payload credit needed by the next publication. Use zero for FIN or a start without metadata.