Struct kodept_ast::TopLevel
source · pub struct TopLevel(/* private fields */);Implementations§
source§impl TopLevel
impl TopLevel
pub fn as_enum(&self) -> Option<&EnumDeclaration>
pub fn as_enum_mut(&mut self) -> Option<&mut EnumDeclaration>
pub fn as_struct(&self) -> Option<&StructDeclaration>
pub fn as_struct_mut(&mut self) -> Option<&mut StructDeclaration>
pub fn as_function(&self) -> Option<&BodiedFunctionDeclaration>
pub fn as_function_mut(&mut self) -> Option<&mut BodiedFunctionDeclaration>
Trait Implementations§
source§impl From<GenericASTNode> for TopLevel
impl From<GenericASTNode> for TopLevel
source§fn from(original: GenericASTNode) -> TopLevel
fn from(original: GenericASTNode) -> TopLevel
Converts to this type from the input type.
source§impl From<TopLevel> for GenericASTNode
impl From<TopLevel> for GenericASTNode
source§impl NodeUnion for TopLevel
impl NodeUnion for TopLevel
fn contains(node: &GenericASTNode) -> bool
fn wrap(node: &GenericASTNode) -> &Self
fn wrap_mut(node: &mut GenericASTNode) -> &mut Self
source§impl PartialEq for TopLevel
impl PartialEq for TopLevel
source§impl<'a> TryFrom<&'a GenericASTNode> for &'a TopLevel
impl<'a> TryFrom<&'a GenericASTNode> for &'a TopLevel
§type Error = <&'a GenericASTNode as TryFrom<&'a GenericASTNode>>::Error
type Error = <&'a GenericASTNode as TryFrom<&'a GenericASTNode>>::Error
The type returned in the event of a conversion error.
source§impl<'a> TryFrom<&'a mut GenericASTNode> for &'a mut TopLevel
impl<'a> TryFrom<&'a mut GenericASTNode> for &'a mut TopLevel
§type Error = <&'a mut GenericASTNode as TryFrom<&'a mut GenericASTNode>>::Error
type Error = <&'a mut GenericASTNode as TryFrom<&'a mut GenericASTNode>>::Error
The type returned in the event of a conversion error.
impl StructuralPartialEq for TopLevel
Auto Trait Implementations§
impl RefUnwindSafe for TopLevel
impl Send for TopLevel
impl Sync for TopLevel
impl Unpin for TopLevel
impl UnwindSafe for TopLevel
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