pub struct AlgolCodec { /* private fields */ }Expand description
Runtime decoder and encoder for the Algol surface, wrapping a PrattParser
over crate::default_pratt_table.
Implements the Decoder, LocatedDecoder, TreeDecoder, Encoder, and
TreeEncoder traits so the codec participates in every decode/encode lane:
it parses infix text into checked Expr forms and renders any Expr back to
infix text.
Trait Implementations§
Source§impl Decoder for AlgolCodec
impl Decoder for AlgolCodec
Source§impl Default for AlgolCodec
impl Default for AlgolCodec
Source§impl Encoder for AlgolCodec
impl Encoder for AlgolCodec
Source§impl LocatedDecoder for AlgolCodec
impl LocatedDecoder for AlgolCodec
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 TreeDecoder for AlgolCodec
impl TreeDecoder for AlgolCodec
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 AlgolCodec
impl TreeEncoder for AlgolCodec
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 AlgolCodec
impl RefUnwindSafe for AlgolCodec
impl Send for AlgolCodec
impl Sync for AlgolCodec
impl Unpin for AlgolCodec
impl UnsafeUnpin for AlgolCodec
impl UnwindSafe for AlgolCodec
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