pub struct WrappedEncoder<T, E> { /* private fields */ }Expand description
Wraps an Encoder, restricting thet type of message that can be encoded.
Implementations§
Source§impl<T, E> WrappedEncoder<T, E>
impl<T, E> WrappedEncoder<T, E>
Sourcepub fn new(encoder: E) -> Self
pub fn new(encoder: E) -> Self
Creates a new WrappedEncoder using the given Encoder.
The new encoder is a TypedEncoder that only encodes values of type T.
Trait Implementations§
Source§impl<T, E> TypedEncoder<T> for WrappedEncoder<T, E>
impl<T, E> TypedEncoder<T> for WrappedEncoder<T, E>
Source§type Error = EncodeError
type Error = EncodeError
Type of error returned by this encoder if encoding fails.
Auto Trait Implementations§
impl<T, E> Freeze for WrappedEncoder<T, E>where
E: Freeze,
impl<T, E> RefUnwindSafe for WrappedEncoder<T, E>where
E: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, E> Send for WrappedEncoder<T, E>
impl<T, E> Sync for WrappedEncoder<T, E>
impl<T, E> Unpin for WrappedEncoder<T, E>
impl<T, E> UnsafeUnpin for WrappedEncoder<T, E>where
E: UnsafeUnpin,
impl<T, E> UnwindSafe for WrappedEncoder<T, E>where
E: UnwindSafe,
T: 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