pub(super) struct PendingStdin {
chunks: VecDeque<Bytes>,
tail: BytesMut,
bytes: usize,
pub(super) closed: bool,
close_pending: bool,
}Expand description
Stdin of a client which the container did not take yet, bounded by
PENDING_STDIN_MAX_BYTES. Small stdin gets merged and large stdin
split into entries of at most STDIN_CHUNK_SIZE, each counts
STDIN_ENTRY_OVERHEAD on top of its bytes. Empty stdin carries nothing,
and nothing takes stdin after the close, both get dropped. The entries
of large stdin keep its message until the container took the last one,
stdin goes to the container in order, so only the oldest message is
partly taken.
Fields§
§chunks: VecDeque<Bytes>Stdin of at least STDIN_MERGE_SIZE bytes and merged small stdin,
the oldest first.
tail: BytesMutSmall stdin after the chunks, merged.
bytes: usizeThe bytes and the overhead of the chunks.
closed: boolWhether the client closed its stdin.
close_pending: boolWhether the close still has to be taken, after the stdin before it.
Implementations§
Source§impl PendingStdin
impl PendingStdin
pub(super) fn is_empty(&self) -> bool
Sourcepub(super) fn len(&self) -> usize
pub(super) fn len(&self) -> usize
What the pending stdin counts against PENDING_STDIN_MAX_BYTES.
Sourcepub(super) fn is_full(&self) -> bool
pub(super) fn is_full(&self) -> bool
Whether the client has to wait, which stops reading the socket.
pub(super) fn push(&mut self, stdin: Stdin)
Sourcefn flush_tail(&mut self)
fn flush_tail(&mut self)
The merged stdin becomes a chunk, so that later stdin goes behind it.
Sourcefn take_tail(&mut self) -> Bytes
fn take_tail(&mut self) -> Bytes
The merged stdin in a buffer of its own. A part of the buffer of the
tail would keep all of it, which can be far more than the stdin it
counts. The tail keeps its buffer, of at most twice
STDIN_CHUNK_SIZE, for the next stdin.
fn push_chunk(&mut self, chunk: Bytes)
Trait Implementations§
Source§impl Debug for PendingStdin
impl Debug for PendingStdin
Auto Trait Implementations§
impl Freeze for PendingStdin
impl RefUnwindSafe for PendingStdin
impl Send for PendingStdin
impl Sync for PendingStdin
impl Unpin for PendingStdin
impl UnsafeUnpin for PendingStdin
impl UnwindSafe for PendingStdin
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
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>
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>,
Layered].