wain_ast/
source.rs

1use std::fmt;
2
3// Trait to handle source for better error message. Wasm has two format text and binary.
4// This trait handles them with one generics.
5pub trait Source: Clone {
6    type Raw;
7    fn describe(&self, f: &mut fmt::Formatter<'_>, offset: usize) -> fmt::Result;
8    fn raw(&self) -> Self::Raw;
9}