Struct mesh_protobuf::EncodeAs
source · 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>
impl<T, U> Downcast<EncodeAs<T, U>> 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)