pub struct BinaryCodec;Expand description
Binary codec runtime object that round-trips kernel Expr values as compact
tagged frames.
As a domain codec it speaks exactly its own byte frame format: it implements
every codec role – Decoder/Encoder, located
LocatedDecoder/LocatedEncoder, and tree
TreeDecoder/TreeEncoder – over the shared Expr graph, and fails
closed (under DecodeLimits) on any input that is not a well-formed frame.
Decoded bytes are treated strictly as data, never as executable input.
Trait Implementations§
Source§impl Decoder for BinaryCodec
impl Decoder for BinaryCodec
Source§impl Encoder for BinaryCodec
impl Encoder for BinaryCodec
Source§impl LocatedDecoder for BinaryCodec
impl LocatedDecoder for BinaryCodec
Source§fn decode_located(
&self,
cx: &mut ReadCx<'_>,
input: Input,
_source_id: String,
) -> Result<LocatedExpr>
fn decode_located( &self, cx: &mut ReadCx<'_>, input: Input, _source_id: String, ) -> Result<LocatedExpr>
Source§impl LocatedEncoder for BinaryCodec
impl LocatedEncoder for BinaryCodec
Source§fn encode_located(
&self,
cx: &mut WriteCx<'_>,
expr: &LocatedExpr,
) -> Result<Output>
fn encode_located( &self, cx: &mut WriteCx<'_>, expr: &LocatedExpr, ) -> Result<Output>
Encode a
LocatedExpr, optionally using its origin for fidelity.Source§impl TreeDecoder for BinaryCodec
impl TreeDecoder for BinaryCodec
Source§fn decode_tree(
&self,
cx: &mut ReadCx<'_>,
input: Input,
_source_id: String,
) -> Result<LocatedExprTree>
fn decode_tree( &self, cx: &mut ReadCx<'_>, input: Input, _source_id: String, ) -> Result<LocatedExprTree>
Source§impl TreeEncoder for BinaryCodec
impl TreeEncoder for BinaryCodec
Source§fn encode_tree(
&self,
cx: &mut WriteCx<'_>,
expr: &LocatedExprTree,
) -> Result<Output>
fn encode_tree( &self, cx: &mut WriteCx<'_>, expr: &LocatedExprTree, ) -> Result<Output>
Encode a
LocatedExprTree, reproducing layout and trivia where present.Auto Trait Implementations§
impl Freeze for BinaryCodec
impl RefUnwindSafe for BinaryCodec
impl Send for BinaryCodec
impl Sync for BinaryCodec
impl Unpin for BinaryCodec
impl UnsafeUnpin for BinaryCodec
impl UnwindSafe for BinaryCodec
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