pub struct TypedMessage<T> {
pub message_type: String,
pub payload: T,
}Expand description
Native payload paired with an explicit wire name; this is not schema proof.
Fields§
§message_type: StringApplication wire name.
payload: TNative serializable value, often a borrowed prepared request.
Implementations§
Trait Implementations§
Source§impl<P: Protocol, T: Serialize> IntoOutboundMessage<P> for TypedMessage<T>
impl<P: Protocol, T: Serialize> IntoOutboundMessage<P> for TypedMessage<T>
Source§fn into_outbound(
self,
ready: &P::Ready,
codec: &dyn EnvelopeCodec,
) -> ClientResult<OutboundMessage>
fn into_outbound( self, ready: &P::Ready, codec: &dyn EnvelopeCodec, ) -> ClientResult<OutboundMessage>
Validate before admission and encode only the layer supplied by the caller.
Auto Trait Implementations§
impl<T> Freeze for TypedMessage<T>where
T: Freeze,
impl<T> RefUnwindSafe for TypedMessage<T>where
T: RefUnwindSafe,
impl<T> Send for TypedMessage<T>where
T: Send,
impl<T> Sync for TypedMessage<T>where
T: Sync,
impl<T> Unpin for TypedMessage<T>where
T: Unpin,
impl<T> UnsafeUnpin for TypedMessage<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for TypedMessage<T>where
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