pub enum StompItem {
Frame(Frame),
Heartbeat,
}Expand description
(parser-based implementation uses src directly; header parsing is
delegated to the parser module.)
Items produced or consumed by the codec.
A StompItem is either a decoded Frame or a Heartbeat marker
representing a single LF received on the wire.
Variants§
Frame(Frame)
A decoded STOMP frame (command + headers + body)
Heartbeat
A single heartbeat pulse (LF)
Trait Implementations§
Source§impl Encoder<StompItem> for StompCodec
impl Encoder<StompItem> for StompCodec
Source§fn encode(
&mut self,
item: StompItem,
dst: &mut BytesMut,
) -> Result<(), Self::Error>
fn encode( &mut self, item: StompItem, dst: &mut BytesMut, ) -> Result<(), Self::Error>
Encode a StompItem into the provided destination buffer.
Parameters
item: theStompItemto encode. The encoder takes ownership of the item (and any containedFrame) and may consume/mutate its contents.dst: destination buffer where encoded bytes should be appended. This is the sameBytesMutprovided by thetokio_util::codecframework (e.g.Framed). Do not replace or reassigndst; instead append bytes into it usingBufMutmethods (put_u8,put_slice,extend_from_slice, etc.). Afterencodereturns the contents ofdstwill be written to the underlying transport.
Returns
Ok(())on success, orErr(io::Error)on encoding-related errors.
impl Eq for StompItem
impl StructuralPartialEq for StompItem
Auto Trait Implementations§
impl Freeze for StompItem
impl RefUnwindSafe for StompItem
impl Send for StompItem
impl Sync for StompItem
impl Unpin for StompItem
impl UnsafeUnpin for StompItem
impl UnwindSafe for StompItem
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