pub struct Ast {
pub ast: Program,
}
Expand description
Fields§
§ast: Program
Implementations§
source§impl Ast
impl Ast
pub fn into_repr(self) -> Program
sourcepub fn to_json_string(&self) -> Result<String>
pub fn to_json_string(&self) -> Result<String>
Serializes the ast into a JSON string.
pub fn to_json_value(&self) -> Result<Value>
sourcepub fn to_json_file(&self, path: PathBuf, file_name: &str) -> Result<()>
pub fn to_json_file(&self, path: PathBuf, file_name: &str) -> Result<()>
Serializes the ast into a JSON file.
sourcepub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
) -> Result<()>
pub fn to_json_file_without_keys(
&self,
path: PathBuf,
file_name: &str,
excluded_keys: &[&str]
) -> Result<()>
Serializes the ast into a JSON value and removes keys from object mappings before writing to a file.
sourcepub fn from_json_string(json: &str) -> Result<Self>
pub fn from_json_string(json: &str) -> Result<Self>
Deserializes the JSON string into a ast.
sourcepub fn from_json_file(path: PathBuf) -> Result<Self>
pub fn from_json_file(path: PathBuf) -> Result<Self>
Deserializes the JSON string into a ast from a file.
Trait Implementations§
impl Eq for Ast
impl StructuralEq for Ast
impl StructuralPartialEq for Ast
Auto Trait Implementations§
impl !RefUnwindSafe for Ast
impl Send for Ast
impl !Sync for Ast
impl Unpin for Ast
impl UnwindSafe for Ast
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.