pub struct GrpcMessage {
pub service: String,
pub method: String,
pub payload: Vec<u8>,
}Expand description
gRPC message: 1-byte compressed flag + 4-byte length + payload.
Fields§
§service: StringService name (e.g., “runtime.v1.RuntimeService”).
method: StringMethod name (e.g., “RunPodSandbox”).
payload: Vec<u8>Raw protobuf-encoded payload.
Implementations§
Source§impl GrpcMessage
impl GrpcMessage
Sourcepub fn new(service: String, method: String, payload: Vec<u8>) -> Self
pub fn new(service: String, method: String, payload: Vec<u8>) -> Self
Create a new gRPC message.
Sourcepub fn encode_payload(&self) -> Vec<u8>
pub fn encode_payload(&self) -> Vec<u8>
Encode the payload into gRPC wire format (length-prefixed message).
Format: [compressed(1)] [length(4)] [message(N)]
Sourcepub fn decode_payload(data: &[u8]) -> Option<(Vec<u8>, usize)>
pub fn decode_payload(data: &[u8]) -> Option<(Vec<u8>, usize)>
Decode a gRPC length-prefixed message from raw bytes.
Returns the decompressed payload and the number of bytes consumed, or None if the buffer is too small.
Trait Implementations§
Source§impl Clone for GrpcMessage
impl Clone for GrpcMessage
Source§fn clone(&self) -> GrpcMessage
fn clone(&self) -> GrpcMessage
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GrpcMessage
impl RefUnwindSafe for GrpcMessage
impl Send for GrpcMessage
impl Sync for GrpcMessage
impl Unpin for GrpcMessage
impl UnwindSafe for GrpcMessage
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)