pub struct Method<Request, Reply> { /* private fields */ }Expand description
Bind an export name, direction limits and Rust DTOs to Wire frames.
An application can infer the lifetimes of borrowing DTOs locally with a type
such as Method<Request<'_>, Reply<'_>>.
Implementations§
Source§impl<Request, Reply> Method<Request, Reply>
impl<Request, Reply> Method<Request, Reply>
Sourcepub const fn new(
name: &'static str,
request_limits: Limits,
reply_limits: Limits,
) -> Self
pub const fn new( name: &'static str, request_limits: Limits, reply_limits: Limits, ) -> Self
Define the Wire method for the exact exported name.
A const descriptor computes the routing ID at compile time. The
configured byte limits include the frame header in each direction.
Sourcepub const fn request_limits(&self) -> Limits
pub const fn request_limits(&self) -> Limits
Get the request limits.
Sourcepub const fn reply_limits(&self) -> Limits
pub const fn reply_limits(&self) -> Limits
Get the reply limits.
Sourcepub fn encode_request<'de>(
&self,
value: &Request,
output: &mut Vec<u8>,
) -> Result<(), Error>where
Request: Evolving<'de>,
pub fn encode_request<'de>(
&self,
value: &Request,
output: &mut Vec<u8>,
) -> Result<(), Error>where
Request: Evolving<'de>,
Encode a request frame into reusable output.
§Errors
Returns an encoding or request admission error.
Sourcepub fn decode_request<'de>(&self, input: &'de [u8]) -> Result<Request, Error>where
Request: Evolving<'de>,
pub fn decode_request<'de>(&self, input: &'de [u8]) -> Result<Request, Error>where
Request: Evolving<'de>,
Decode a request frame for this method.
§Errors
Returns a framing, decoding, incompatibility, or request admission error.
Auto Trait Implementations§
impl<Request, Reply> Forget for Method<Request, Reply>
impl<Request, Reply> Freeze for Method<Request, Reply>
impl<Request, Reply> Move for Method<Request, Reply>
impl<Request, Reply> RefUnwindSafe for Method<Request, Reply>
impl<Request, Reply> Send for Method<Request, Reply>
impl<Request, Reply> Sync for Method<Request, Reply>
impl<Request, Reply> Unpin for Method<Request, Reply>
impl<Request, Reply> UnsafeUnpin for Method<Request, Reply>
impl<Request, Reply> UnwindSafe for Method<Request, Reply>where
&'static str: UnwindSafe,
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