pub enum ModuleItem {
Module(Module),
Struct(Struct),
Function(Function),
VariableDefinition(VariableDefinition),
Trait(Trait),
Enum(Enum),
Impl(Impl),
Null,
}Expand description
A module item
Variants§
Module(Module)
Struct(Struct)
Function(Function)
VariableDefinition(VariableDefinition)
Trait(Trait)
Enum(Enum)
Impl(Impl)
Null
Implementations§
Source§impl ModuleItem
impl ModuleItem
Sourcepub fn as_module_mut(&mut self) -> Option<&mut Module>
pub fn as_module_mut(&mut self) -> Option<&mut Module>
Optionally returns mutable references to the inner fields if this is a ModuleItem::Module, otherwise None
Sourcepub fn as_module(&self) -> Option<&Module>
pub fn as_module(&self) -> Option<&Module>
Optionally returns references to the inner fields if this is a ModuleItem::Module, otherwise None
Sourcepub fn into_module(self) -> Result<Module, Self>
pub fn into_module(self) -> Result<Module, Self>
Returns the inner fields if this is a ModuleItem::Module, otherwise returns back the enum in the Err case of the result
Sourcepub fn as_struct_mut(&mut self) -> Option<&mut Struct>
pub fn as_struct_mut(&mut self) -> Option<&mut Struct>
Optionally returns mutable references to the inner fields if this is a ModuleItem::Struct, otherwise None
Sourcepub fn as_struct(&self) -> Option<&Struct>
pub fn as_struct(&self) -> Option<&Struct>
Optionally returns references to the inner fields if this is a ModuleItem::Struct, otherwise None
Sourcepub fn into_struct(self) -> Result<Struct, Self>
pub fn into_struct(self) -> Result<Struct, Self>
Returns the inner fields if this is a ModuleItem::Struct, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_function(&self) -> bool
pub fn is_function(&self) -> bool
Returns true if this is a ModuleItem::Function, otherwise false
Sourcepub fn as_function_mut(&mut self) -> Option<&mut Function>
pub fn as_function_mut(&mut self) -> Option<&mut Function>
Optionally returns mutable references to the inner fields if this is a ModuleItem::Function, otherwise None
Sourcepub fn as_function(&self) -> Option<&Function>
pub fn as_function(&self) -> Option<&Function>
Optionally returns references to the inner fields if this is a ModuleItem::Function, otherwise None
Sourcepub fn into_function(self) -> Result<Function, Self>
pub fn into_function(self) -> Result<Function, Self>
Returns the inner fields if this is a ModuleItem::Function, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_variable_definition(&self) -> bool
pub fn is_variable_definition(&self) -> bool
Returns true if this is a ModuleItem::VariableDefinition, otherwise false
Sourcepub fn as_variable_definition_mut(&mut self) -> Option<&mut VariableDefinition>
pub fn as_variable_definition_mut(&mut self) -> Option<&mut VariableDefinition>
Optionally returns mutable references to the inner fields if this is a ModuleItem::VariableDefinition, otherwise None
Sourcepub fn as_variable_definition(&self) -> Option<&VariableDefinition>
pub fn as_variable_definition(&self) -> Option<&VariableDefinition>
Optionally returns references to the inner fields if this is a ModuleItem::VariableDefinition, otherwise None
Sourcepub fn into_variable_definition(self) -> Result<VariableDefinition, Self>
pub fn into_variable_definition(self) -> Result<VariableDefinition, Self>
Returns the inner fields if this is a ModuleItem::VariableDefinition, otherwise returns back the enum in the Err case of the result
Sourcepub fn as_trait_mut(&mut self) -> Option<&mut Trait>
pub fn as_trait_mut(&mut self) -> Option<&mut Trait>
Optionally returns mutable references to the inner fields if this is a ModuleItem::Trait, otherwise None
Sourcepub fn as_trait(&self) -> Option<&Trait>
pub fn as_trait(&self) -> Option<&Trait>
Optionally returns references to the inner fields if this is a ModuleItem::Trait, otherwise None
Sourcepub fn into_trait(self) -> Result<Trait, Self>
pub fn into_trait(self) -> Result<Trait, Self>
Returns the inner fields if this is a ModuleItem::Trait, otherwise returns back the enum in the Err case of the result
Sourcepub fn as_enum_mut(&mut self) -> Option<&mut Enum>
pub fn as_enum_mut(&mut self) -> Option<&mut Enum>
Optionally returns mutable references to the inner fields if this is a ModuleItem::Enum, otherwise None
Sourcepub fn as_enum(&self) -> Option<&Enum>
pub fn as_enum(&self) -> Option<&Enum>
Optionally returns references to the inner fields if this is a ModuleItem::Enum, otherwise None
Sourcepub fn into_enum(self) -> Result<Enum, Self>
pub fn into_enum(self) -> Result<Enum, Self>
Returns the inner fields if this is a ModuleItem::Enum, otherwise returns back the enum in the Err case of the result
Sourcepub fn as_impl_mut(&mut self) -> Option<&mut Impl>
pub fn as_impl_mut(&mut self) -> Option<&mut Impl>
Optionally returns mutable references to the inner fields if this is a ModuleItem::Impl, otherwise None
Sourcepub fn as_impl(&self) -> Option<&Impl>
pub fn as_impl(&self) -> Option<&Impl>
Optionally returns references to the inner fields if this is a ModuleItem::Impl, otherwise None
Trait Implementations§
Source§impl Clone for ModuleItem
impl Clone for ModuleItem
Source§fn clone(&self) -> ModuleItem
fn clone(&self) -> ModuleItem
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more