Struct Codec
pub struct Codec<Req, Resp> { /* private fields */ }Available on crate features
cbor and request-response only.Implementations§
§impl<Req, Resp> Codec<Req, Resp>
impl<Req, Resp> Codec<Req, Resp>
pub fn set_request_size_maximum(
self,
request_size_maximum: u64,
) -> Codec<Req, Resp>
pub fn set_request_size_maximum( self, request_size_maximum: u64, ) -> Codec<Req, Resp>
Sets the limit for request size in bytes.
pub fn set_response_size_maximum(
self,
response_size_maximum: u64,
) -> Codec<Req, Resp>
pub fn set_response_size_maximum( self, response_size_maximum: u64, ) -> Codec<Req, Resp>
Sets the limit for response size in bytes.
Trait Implementations§
§impl<Req, Resp> Codec for Codec<Req, Resp>
impl<Req, Resp> Codec for Codec<Req, Resp>
§type Protocol = StreamProtocol
type Protocol = StreamProtocol
The type of protocol(s) or protocol versions being negotiated.
§async fn read_request<T>(
&mut self,
_: &<Codec<Req, Resp> as Codec>::Protocol,
io: &mut T,
) -> Result<Req, Error>
async fn read_request<T>( &mut self, _: &<Codec<Req, Resp> as Codec>::Protocol, io: &mut T, ) -> Result<Req, Error>
Reads a request from the given I/O stream according to the
negotiated protocol.
§async fn read_response<T>(
&mut self,
_: &<Codec<Req, Resp> as Codec>::Protocol,
io: &mut T,
) -> Result<Resp, Error>
async fn read_response<T>( &mut self, _: &<Codec<Req, Resp> as Codec>::Protocol, io: &mut T, ) -> Result<Resp, Error>
Reads a response from the given I/O stream according to the
negotiated protocol.
Auto Trait Implementations§
impl<Req, Resp> Forget for Codec<Req, Resp>
impl<Req, Resp> Freeze for Codec<Req, Resp>
impl<Req, Resp> Move for Codec<Req, Resp>
impl<Req, Resp> RefUnwindSafe for Codec<Req, Resp>
impl<Req, Resp> Send for Codec<Req, Resp>
impl<Req, Resp> Sync for Codec<Req, Resp>
impl<Req, Resp> Unpin for Codec<Req, Resp>
impl<Req, Resp> UnsafeUnpin for Codec<Req, Resp>
impl<Req, Resp> UnwindSafe for Codec<Req, Resp>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
§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> ⓘ
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 more