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> DefaultEncoding for EncodeAs<T, U>
impl<T, U> 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, U> 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
)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> SerializeMessage for Twhere
T: MeshPayload,
impl<T> SerializeMessage for Twhere
T: MeshPayload,
source§fn compute_message_size(&mut self, sizer: MessageSizer<'_>)
fn compute_message_size(&mut self, sizer: MessageSizer<'_>)
Computes the message size, as in
MessageEncode::compute_message_size
.source§fn write_message(self, writer: MessageWriter<'_, '_, Resource>)
fn write_message(self, writer: MessageWriter<'_, '_, Resource>)
Writes the message, as in
MessageEncode::write_message
.source§fn extract(self) -> <T as SerializeMessage>::Concrete
fn extract(self) -> <T as SerializeMessage>::Concrete
Extract the concrete message.