pub enum Frame {
Item(Vec<u8>),
End,
Error(PluginError),
}Expand description
One frame crossing the streaming boundary.
Item carries opaque payload bytes (the caller decides how to decode them —
typically wire::deserialize::<T>() or a Value), so this type stays
backend- and schema-neutral.
Variants§
Item(Vec<u8>)
One streamed item; bytes are the bincode/Value payload.
End
Clean end of stream.
Error(PluginError)
Producer failed mid-stream; the stream terminates here.
Implementations§
Source§impl Frame
impl Frame
Sourcepub fn decode(bytes: &[u8]) -> Result<Frame, FrameError>
pub fn decode(bytes: &[u8]) -> Result<Frame, FrameError>
Decode exactly one frame from bytes, which must contain a single frame
and nothing more. Use Frame::read to pull one frame from a larger
buffer and learn how many bytes were consumed.
Trait Implementations§
impl StructuralPartialEq for Frame
Auto Trait Implementations§
impl Freeze for Frame
impl RefUnwindSafe for Frame
impl Send for Frame
impl Sync for Frame
impl Unpin for Frame
impl UnsafeUnpin for Frame
impl UnwindSafe for Frame
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