pub struct Codec { /* private fields */ }Expand description
A configured codec server.
Implementations§
Source§impl Codec
impl Codec
pub fn new(endpoint: impl Into<String>, auth: Option<String>) -> Self
Sourcepub async fn decode(
&self,
namespace: &str,
payloads: &[Payload],
) -> Result<Vec<Payload>, OpError>
pub async fn decode( &self, namespace: &str, payloads: &[Payload], ) -> Result<Vec<Payload>, OpError>
Decode a batch of payloads.
Batched rather than one call per payload: a row carries several, and a codec server is usually a network hop away.
The server is required to return exactly as many payloads as it was given, in order, that is what makes the result assignable back to what was sent. A server that returns a different number is a protocol error rather than something to guess around, because pairing them up wrongly would show one payload’s plaintext under another’s label.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Codec
impl !UnwindSafe for Codec
impl Freeze for Codec
impl Send for Codec
impl Sync for Codec
impl Unpin for Codec
impl UnsafeUnpin for Codec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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