pub struct NativeFrameHeader {
pub opcode: NativeOpcode,
pub request_id: u128,
pub status: NativeStatus,
pub is_response: bool,
pub payload_len: u32,
/* private fields */
}Expand description
Validated fixed header for one multiplexed native frame.
Fields§
§opcode: NativeOpcodeOperation associated with the frame.
request_id: u128Caller-selected ID copied into the response.
status: NativeStatusResponse status; requests must use NativeStatus::Ok.
is_response: boolWhether this frame is a server response.
payload_len: u32Number of payload bytes following the header.
Implementations§
Source§impl NativeFrameHeader
impl NativeFrameHeader
Sourcepub fn request(
opcode: NativeOpcode,
request_id: u128,
payload: &[u8],
) -> Result<Self, NativeProtocolError>
pub fn request( opcode: NativeOpcode, request_id: u128, payload: &[u8], ) -> Result<Self, NativeProtocolError>
Creates a request header for payload.
Sourcepub fn response(
opcode: NativeOpcode,
request_id: u128,
status: NativeStatus,
payload: &[u8],
) -> Result<Self, NativeProtocolError>
pub fn response( opcode: NativeOpcode, request_id: u128, status: NativeStatus, payload: &[u8], ) -> Result<Self, NativeProtocolError>
Creates a response header for payload.
Sourcepub fn decode(bytes: &[u8; 32]) -> Result<Self, NativeProtocolError>
pub fn decode(bytes: &[u8; 32]) -> Result<Self, NativeProtocolError>
Decodes and validates a fixed-width wire header.
Sourcepub fn verify_payload(self, payload: &[u8]) -> Result<(), NativeProtocolError>
pub fn verify_payload(self, payload: &[u8]) -> Result<(), NativeProtocolError>
Verifies that payload has the declared length and BLAKE3 checksum.
Trait Implementations§
Source§impl Clone for NativeFrameHeader
impl Clone for NativeFrameHeader
impl Copy for NativeFrameHeader
Source§impl Debug for NativeFrameHeader
impl Debug for NativeFrameHeader
impl Eq for NativeFrameHeader
Source§impl PartialEq for NativeFrameHeader
impl PartialEq for NativeFrameHeader
impl StructuralPartialEq for NativeFrameHeader
Auto Trait Implementations§
impl Freeze for NativeFrameHeader
impl RefUnwindSafe for NativeFrameHeader
impl Send for NativeFrameHeader
impl Sync for NativeFrameHeader
impl Unpin for NativeFrameHeader
impl UnsafeUnpin for NativeFrameHeader
impl UnwindSafe for NativeFrameHeader
Blanket Implementations§
impl<T> Allocation for T
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
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§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
Compare self to
key and return true if they are equal.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> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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 moreSource§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