pub(crate) struct StreamSender {
pub(super) id: u32,
pub(super) shared: Arc<Shared>,
pub(super) reset: CancellationToken,
pub(super) queued: Arc<Queued>,
pub(super) closed: bool,
pub(super) _live: Arc<Live>,
}Expand description
The sending side of a stream. Dropping it without closing it resets the stream.
Fields§
§id: u32§reset: CancellationToken§queued: Arc<Queued>The frames of the stream in the data queue.
closed: bool§_live: Arc<Live>Implementations§
Source§impl StreamSender
impl StreamSender
Sourcepub(crate) async fn send(&mut self, data: Bytes) -> Result<()>
pub(crate) async fn send(&mut self, data: Bytes) -> Result<()>
Send data in a single frame, at most
MAX_DATA_FRAME_LEN bytes. Fails
once the stream got reset or the connection ended.
Sourcepub(crate) async fn close(&mut self) -> Result<()>
pub(crate) async fn close(&mut self) -> Result<()>
Close the sending side after the data sent before. A close which got cancelled leaves the stream to its drop, which resets it.
Sourcepub(super) fn reset(&mut self)
pub(super) fn reset(&mut self)
Reset the stream, both sides end. The data queued for the stream before goes out first. Users reset a stream by dropping it without closing it, the tests also directly.
Sourcepub(crate) async fn reset_by_peer(&self)
pub(crate) async fn reset_by_peer(&self)
Resolves once the client reset the stream or the connection ended.
Trait Implementations§
Source§impl Drop for StreamSender
impl Drop for StreamSender
Auto Trait Implementations§
impl Freeze for StreamSender
impl RefUnwindSafe for StreamSender
impl Send for StreamSender
impl Sync for StreamSender
impl Unpin for StreamSender
impl UnsafeUnpin for StreamSender
impl UnwindSafe for StreamSender
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].