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>
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§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: 'static + MeshPayload + Send,
impl<T> SerializeMessage for Twhere
T: 'static + MeshPayload + Send,
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.