MCPcopy Index your code
hub / github.com/RustPython/RustPython / Node

Interface Node

crates/vm/src/stdlib/_ast/node.rs:4–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2use rustpython_compiler_core::SourceFile;
3
4pub(crate) trait Node: Sized {
5 fn ast_to_object(self, vm: &VirtualMachine, source_file: &SourceFile) -> PyObjectRef;
6 fn ast_from_object(
7 vm: &VirtualMachine,
8 source_file: &SourceFile,
9 object: PyObjectRef,
10 ) -> PyResult<Self>;
11
12 /// Used in `Option::ast_from_object`; if `true`, that impl will return None.
13 fn is_none(&self) -> bool {
14 false
15 }
16}
17
18impl<T: Node> Node for Vec<T> {
19 fn ast_to_object(self, vm: &VirtualMachine, source_file: &SourceFile) -> PyObjectRef {

Callers 1

pyast.rsFile · 0.70

Implementers 15

exception.rscrates/vm/src/stdlib/_ast/exception.rs
argument.rscrates/vm/src/stdlib/_ast/argument.rs
other.rscrates/vm/src/stdlib/_ast/other.rs
module.rscrates/vm/src/stdlib/_ast/module.rs
expression.rscrates/vm/src/stdlib/_ast/expression.r
operator.rscrates/vm/src/stdlib/_ast/operator.rs
constant.rscrates/vm/src/stdlib/_ast/constant.rs
string.rscrates/vm/src/stdlib/_ast/string.rs
basic.rscrates/vm/src/stdlib/_ast/basic.rs
statement.rscrates/vm/src/stdlib/_ast/statement.rs
type_ignore.rscrates/vm/src/stdlib/_ast/type_ignore.
pattern.rscrates/vm/src/stdlib/_ast/pattern.rs

Calls

no outgoing calls

Tested by

no test coverage detected