pub struct EncodeAs<T, U>(/* private fields */);
Expand description
Wrapper type to easily support custom mesh encoding.
This type acts as T
but encodes on a mesh channel as U
. This is useful
when T
cannot be encoded directly via the derive macro but can be
converted to a type that can be encoded directly.
Implementations§
Source§impl<T, U> EncodeAs<T, U>
impl<T, U> EncodeAs<T, U>
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Extracts the inner T
.
Trait Implementations§
Source§impl<T, U: From<T> + Into<T> + DefaultEncoding> DefaultEncoding for EncodeAs<T, U>
impl<T, U: From<T> + Into<T> + DefaultEncoding> DefaultEncoding for EncodeAs<T, U>
Source§type Encoding = MessageEncoding<EncodedMessage<<U as DefaultEncoding>::Encoding>>
type Encoding = MessageEncoding<EncodedMessage<<U as DefaultEncoding>::Encoding>>
The encoding to use for the serialization. Read more
impl<T: Copy, U: Copy> Copy for EncodeAs<T, U>
Auto Trait Implementations§
impl<T, U> Freeze for EncodeAs<T, U>
impl<T, U> RefUnwindSafe for EncodeAs<T, U>where
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U> Send for EncodeAs<T, U>
impl<T, U> Sync for EncodeAs<T, U>
impl<T, U> Unpin for EncodeAs<T, U>
impl<T, U> UnwindSafe for EncodeAs<T, U>where
T: UnwindSafe,
U: 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