pub enum WsFrame<T> {
Single(T),
Array(Vec<T>),
}Expand description
A parsed WebSocket frame — either a single object or an array-of-objects.
Many exchanges send batched updates as a top-level JSON array. Rather
than parse twice (once as Value to peek, once as the typed struct),
decode_frame dispatches based on the first non-whitespace byte.
Variants§
Implementations§
Auto Trait Implementations§
impl<T> Freeze for WsFrame<T>where
T: Freeze,
impl<T> RefUnwindSafe for WsFrame<T>where
T: RefUnwindSafe,
impl<T> Send for WsFrame<T>where
T: Send,
impl<T> Sync for WsFrame<T>where
T: Sync,
impl<T> Unpin for WsFrame<T>where
T: Unpin,
impl<T> UnsafeUnpin for WsFrame<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for WsFrame<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