pub trait FrameWrite {
type Error: Debug;
// Required method
fn encode<W: Writer>(&self, buf: &mut W) -> Result<(), Self::Error>;
}Expand description
Encodes Self into a Writer.
A single generic method covers both alloc (BytesMut) and no-alloc
(&mut [u8]) targets - no cfg splits required in implementations.
Most types should use #[derive(FrameWrite)] from ace-macros.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl FrameWrite for &[u8]
impl FrameWrite for &[u8]
Source§impl FrameWrite for u8
impl FrameWrite for u8
Source§impl FrameWrite for u16
impl FrameWrite for u16
Source§impl FrameWrite for u32
impl FrameWrite for u32
Source§impl<T: FrameWrite> FrameWrite for Option<T>
impl<T: FrameWrite> FrameWrite for Option<T>
Implementors§
Source§impl<'a, T> FrameWrite for FrameIter<'a, T>
Encodes by writing the raw underlying bytes directly.
impl<'a, T> FrameWrite for FrameIter<'a, T>
Encodes by writing the raw underlying bytes directly.
FrameIter stores the original encoded bytes verbatim - encoding simply
copies them out. No re-decode/re-encode cycle is needed or performed.
No bounds on T required since the bytes are written as-is.