pub struct Module {
pub raw: RawModule,
pub name: Option<Name>,
pub doc: Option<String>,
pub filename: Option<String>,
pub attributes: HashMap<Name, String>,
}
Expand description
Represents a module as imported from an ast.
Fields§
§raw: RawModule
§name: Option<Name>
§doc: Option<String>
§filename: Option<String>
§attributes: HashMap<Name, String>
Trait Implementations§
Source§impl CodeGen for Module
impl CodeGen for Module
Source§type Context = CodeGenContext
type Context = CodeGenContext
A type, generally an enum, that passes the code generator the context of the node.
Source§type Options = PythonOptions
type Options = PythonOptions
A struct representing the set of compilation options.
Source§type SymbolTable = SymbolTableScopes
type SymbolTable = SymbolTableScopes
A trait for a symbol table
Source§fn find_symbols(self, symbols: Self::SymbolTable) -> Self::SymbolTable
fn find_symbols(self, symbols: Self::SymbolTable) -> Self::SymbolTable
A default implementation for find_symbols(), which simply returns the input.
Language nodes that modify the symbol table should override this method.
Source§fn to_rust(
self,
ctx: Self::Context,
options: Self::Options,
symbols: Self::SymbolTable,
) -> Result<TokenStream, Box<dyn Error>>
fn to_rust( self, ctx: Self::Context, options: Self::Options, symbols: Self::SymbolTable, ) -> Result<TokenStream, Box<dyn Error>>
A trait method to output Rust code in a general sense. The output should be stream of Rust tokens,
however, it is not guaranteed that it will fully compile because of scoping errors and other checks
that don’t occur until later.
Source§fn get_docstring(&self) -> Option<String>
fn get_docstring(&self) -> Option<String>
A trait method for extracting a docstring from an object that can have a docstring.
Source§impl<'de> Deserialize<'de> for Module
impl<'de> Deserialize<'de> for Module
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a> FromPyObject<'a> for Module
impl<'a> FromPyObject<'a> for Module
Source§impl Object for Module
impl Object for Module
Source§fn id(&self) -> usize
fn id(&self) -> usize
Returns the unique identifier of the object, which is the memory address of the object.
Source§fn __getattribute__(&self, _name: impl AsRef<str>) -> Option<impl Object>
fn __getattribute__(&self, _name: impl AsRef<str>) -> Option<impl Object>
getattribute is called to look up an attribute of the object.
Source§fn __setattribute__<T: Object>(&mut self, _name: impl AsRef<str>, _value: T)
fn __setattribute__<T: Object>(&mut self, _name: impl AsRef<str>, _value: T)
setattribute is called to set an attribute of the object.
Source§fn __delattribute__(&mut self, _name: impl AsRef<str>)
fn __delattribute__(&mut self, _name: impl AsRef<str>)
delattribute is called to delete an attribute of the object.
Auto Trait Implementations§
impl Freeze for Module
impl RefUnwindSafe for Module
impl Send for Module
impl Sync for Module
impl Unpin for Module
impl UnwindSafe for Module
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