#[non_exhaustive]pub struct Frame<C, T = Value>where
C: ChannelKind,{
pub channel: C,
pub cursor: Option<u64>,
pub payload: T,
pub client_id: Option<Uuid>,
}Expand description
Envelope for multiplexed frames. Payloads are intentionally generic so downstream services can attach their own typed content.
C is the channel type (implements ChannelKind).
T is the payload type (defaults to serde_json::Value).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.channel: C§cursor: Option<u64>§payload: T§client_id: Option<Uuid>Implementations§
Source§impl<C, T> Frame<C, T>where
C: ChannelKind,
impl<C, T> Frame<C, T>where
C: ChannelKind,
Trait Implementations§
Source§impl<'de, C, T> Deserialize<'de> for Frame<C, T>where
C: ChannelKind,
T: DeserializeOwned,
impl<'de, C, T> Deserialize<'de> for Frame<C, T>where
C: ChannelKind,
T: DeserializeOwned,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Frame<C, T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Frame<C, T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<C, T> Serialize for Frame<C, T>where
C: ChannelKind,
T: Serialize,
impl<C, T> Serialize for Frame<C, T>where
C: ChannelKind,
T: Serialize,
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl<C, T> Freeze for Frame<C, T>
impl<C, T> RefUnwindSafe for Frame<C, T>where
C: RefUnwindSafe,
T: RefUnwindSafe,
impl<C, T> Send for Frame<C, T>where
T: Send,
impl<C, T> Sync for Frame<C, T>where
T: Sync,
impl<C, T> Unpin for Frame<C, T>
impl<C, T> UnsafeUnpin for Frame<C, T>where
C: UnsafeUnpin,
T: UnsafeUnpin,
impl<C, T> UnwindSafe for Frame<C, T>where
C: UnwindSafe,
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