pub trait TreeEncoder: Send + Sync {
// Required method
fn encode_tree(
&self,
cx: &mut WriteCx<'_>,
expr: &LocatedExprTree,
) -> Result<Output>;
}Expand description
An encoder that consumes a full LocatedExprTree, able to reproduce trivia
and exact layout for lossless round-trips.
Required Methods§
Sourcefn 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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".