pub struct PackChunk {
pub offset: u64,
pub data: Vec<u8>,
pub last: bool,
}Expand description
One bounded-size segment of a streamed pack transfer.
Mirrors the wire-level PackChunk shape shared by the SSH and enc
transports (offset, data, last — see
mkit-rpc/proto/mkit/rpc/v1/ssh/ssh.proto) and the mkit.transport.v1
Connect proto being designed for the HTTP
reference worker, without this crate depending on any
protobuf-generated type: mkit-core is the dependency root that
mkit-rpc builds on, not the reverse (see this module’s header
comment), so the canonical protobuf PackChunk cannot be named here.
Transports convert 1:1 between this type and their own wire
representation.
Fields§
§offset: u64Byte offset of data within the pack. Consecutive chunks in one
transfer MUST have ascending, contiguous offsets starting at 0 —
i.e. chunk n’s offset equals the sum of every prior chunk’s
data.len().
data: Vec<u8>Chunk payload. Transports typically bound this to a fixed
per-frame maximum (e.g. mkit_rpc::CHUNK_DATA_MAX, 800 KiB for
SSH/enc) so no single chunk forces a large allocation.
last: booltrue on the final chunk of the stream. An empty pack is still
represented as exactly one chunk with last = true and empty
data — a stream MUST NOT end silently without a last = true
chunk.
Trait Implementations§
impl Eq for PackChunk
impl StructuralPartialEq for PackChunk
Auto Trait Implementations§
impl Freeze for PackChunk
impl RefUnwindSafe for PackChunk
impl Send for PackChunk
impl Sync for PackChunk
impl Unpin for PackChunk
impl UnsafeUnpin for PackChunk
impl UnwindSafe for PackChunk
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more