pub struct DeclareStatements {
pub source: String,
pub kind: DeclareKind,
}Expand description
Represents declarations in source code.
This struct is used to store various types of declarations found in source files, such as imports, use statements, and module declarations.
§Examples
use codebank::{DeclareStatements, DeclareKind};
// Create an import declaration
let import = DeclareStatements {
source: "use std::io;".to_string(),
kind: DeclareKind::Import,
};
assert!(matches!(import.kind, DeclareKind::Import));
// Create a module declaration
let module = DeclareStatements {
source: "mod example;".to_string(),
kind: DeclareKind::Mod,
};
assert!(matches!(module.kind, DeclareKind::Mod));Fields§
§source: StringThe source code of the declaration
kind: DeclareKindThe kind of declaration
Trait Implementations§
Source§impl Debug for DeclareStatements
impl Debug for DeclareStatements
Source§impl Default for DeclareStatements
impl Default for DeclareStatements
Source§fn default() -> DeclareStatements
fn default() -> DeclareStatements
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DeclareStatements
impl RefUnwindSafe for DeclareStatements
impl Send for DeclareStatements
impl Sync for DeclareStatements
impl Unpin for DeclareStatements
impl UnwindSafe for DeclareStatements
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