pub struct BinaryRequestBodyChunkEvent {
pub correlation_id: String,
pub data: Bytes,
pub is_last: bool,
pub total_size: Option<usize>,
pub chunk_index: u32,
pub bytes_received: usize,
}Expand description
Binary request body chunk event.
This type uses Bytes for zero-copy body streaming, avoiding the base64
encode/decode overhead of RequestBodyChunkEvent. Use this type for:
- Binary UDS transport (with
binary-udsfeature) - gRPC transport (protobuf already uses bytes)
- Any transport that supports raw binary data
For JSON transport, use RequestBodyChunkEvent with base64-encoded data.
Fields§
§correlation_id: StringCorrelation ID
data: BytesBody chunk data (raw bytes, no encoding)
is_last: boolIs this the last chunk?
total_size: Option<usize>Total body size if known
chunk_index: u32Chunk index for ordering (0-based)
bytes_received: usizeBytes received so far (cumulative)
Implementations§
Source§impl BinaryRequestBodyChunkEvent
impl BinaryRequestBodyChunkEvent
Sourcepub fn new(
correlation_id: impl Into<String>,
data: impl Into<Bytes>,
chunk_index: u32,
is_last: bool,
) -> Self
pub fn new( correlation_id: impl Into<String>, data: impl Into<Bytes>, chunk_index: u32, is_last: bool, ) -> Self
Create a new binary request body chunk event.
Sourcepub fn with_total_size(self, size: usize) -> Self
pub fn with_total_size(self, size: usize) -> Self
Set the total body size.
Sourcepub fn with_bytes_received(self, bytes: usize) -> Self
pub fn with_bytes_received(self, bytes: usize) -> Self
Set cumulative bytes received.
Trait Implementations§
Source§impl Clone for BinaryRequestBodyChunkEvent
impl Clone for BinaryRequestBodyChunkEvent
Source§fn clone(&self) -> BinaryRequestBodyChunkEvent
fn clone(&self) -> BinaryRequestBodyChunkEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BinaryRequestBodyChunkEvent
impl Debug for BinaryRequestBodyChunkEvent
Source§impl From<&RequestBodyChunkEvent> for BinaryRequestBodyChunkEvent
impl From<&RequestBodyChunkEvent> for BinaryRequestBodyChunkEvent
Source§fn from(event: &RequestBodyChunkEvent) -> Self
fn from(event: &RequestBodyChunkEvent) -> Self
Convert base64-encoded body chunk to binary type.
If base64 decoding fails, falls back to treating data as raw UTF-8 bytes.
Source§impl From<BinaryRequestBodyChunkEvent> for RequestBodyChunkEvent
impl From<BinaryRequestBodyChunkEvent> for RequestBodyChunkEvent
Source§fn from(event: BinaryRequestBodyChunkEvent) -> Self
fn from(event: BinaryRequestBodyChunkEvent) -> Self
Convert binary body chunk to base64-encoded JSON-compatible type.
Auto Trait Implementations§
impl !Freeze for BinaryRequestBodyChunkEvent
impl RefUnwindSafe for BinaryRequestBodyChunkEvent
impl Send for BinaryRequestBodyChunkEvent
impl Sync for BinaryRequestBodyChunkEvent
impl Unpin for BinaryRequestBodyChunkEvent
impl UnwindSafe for BinaryRequestBodyChunkEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request