pub struct Include(/* private fields */);Expand description
An AST node for $ast
Implementations§
Source§impl Include
impl Include
Sourcepub fn is_optional(&self) -> bool
pub fn is_optional(&self) -> bool
Check if this is an optional include (-include or sinclude)
Sourcepub fn parent(&self) -> Option<MakefileItem>
pub fn parent(&self) -> Option<MakefileItem>
Get the parent item of this include directive, if any
Returns Some(MakefileItem) if this include has a parent that is a MakefileItem
(e.g., a Conditional), or None if the parent is the root Makefile node.
§Example
use makefile_lossless::Makefile;
let makefile: Makefile = r#"ifdef DEBUG
include debug.mk
endif
"#.parse().unwrap();
let cond = makefile.conditionals().next().unwrap();
let inc = cond.if_items().next().unwrap();
// Include's parent is the conditional
assert!(matches!(inc, makefile_lossless::MakefileItem::Include(_)));Trait Implementations§
impl Eq for Include
impl StructuralPartialEq for Include
Auto Trait Implementations§
impl Freeze for Include
impl !RefUnwindSafe for Include
impl !Send for Include
impl !Sync for Include
impl Unpin for Include
impl !UnwindSafe for Include
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