pub struct DecodedRequestBody { /* private fields */ }Expand description
A request body decoded exactly once, with its derived full method leaf.
Constructed by generated service decoders via DecodedRequestBody::from_message,
or — only for services with no Cap’n Proto request schema (test echo
services, byte-oriented bridges) — via DecodedRequestBody::opaque.
Implementations§
Source§impl DecodedRequestBody
impl DecodedRequestBody
Sourcepub fn from_message(
bytes: Vec<u8>,
message: Reader<OwnedSegments>,
leaf_path: Vec<u16>,
) -> Result<Self>
pub fn from_message( bytes: Vec<u8>, message: Reader<OwnedSegments>, leaf_path: Vec<u16>, ) -> Result<Self>
Wrap the one decoded message and its derived leaf path.
Generated decoders call this after the single bounded
read_message + leaf traversal. The leaf path must be non-empty: a
request whose root union arm is unknown never reaches this
constructor (the generated decoder returns an error instead).
Sourcepub fn opaque(bytes: Vec<u8>) -> Self
pub fn opaque(bytes: Vec<u8>) -> Self
A body for a service with no Cap’n Proto request schema.
The body carries raw bytes only: there is no decoded message and no derivable method leaf, so a proof-bearing request to such a service denies at leaf derivation (v16 §5.2) and generated dispatch cannot be served from it. This exists for byte-oriented test/bridge services and is an affirmative per-service choice, never a default.
Sourcepub fn leaf_path(&self) -> Option<&[u16]>
pub fn leaf_path(&self) -> Option<&[u16]>
The full numeric method leaf path, or None for an opaque body.
Sourcepub fn leaf_path_string(&self) -> Option<String>
pub fn leaf_path_string(&self) -> Option<String>
The leaf path in the dotted form generated policy rows are keyed by.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for DecodedRequestBody
impl !RefUnwindSafe for DecodedRequestBody
impl Send for DecodedRequestBody
impl !Sync for DecodedRequestBody
impl Unpin for DecodedRequestBody
impl UnsafeUnpin for DecodedRequestBody
impl UnwindSafe for DecodedRequestBody
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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