pub enum DeclareKind {
Import,
Use,
Mod,
Other(String),
}
Expand description
The kind of declaration statement.
§Examples
use codebank::DeclareKind;
// Import declaration
let kind = DeclareKind::Import;
assert!(matches!(kind, DeclareKind::Import));
// Use declaration
let kind = DeclareKind::Use;
assert!(matches!(kind, DeclareKind::Use));
// Module declaration
let kind = DeclareKind::Mod;
assert!(matches!(kind, DeclareKind::Mod));
// Other declaration types
let kind = DeclareKind::Other("macro_rules".to_string());
assert!(matches!(kind, DeclareKind::Other(_)));
Variants§
Trait Implementations§
Source§impl Debug for DeclareKind
impl Debug for DeclareKind
Source§impl Default for DeclareKind
impl Default for DeclareKind
Source§fn default() -> DeclareKind
fn default() -> DeclareKind
Returns the “default value” for a type. Read more
Source§impl PartialEq for DeclareKind
impl PartialEq for DeclareKind
impl StructuralPartialEq for DeclareKind
Auto Trait Implementations§
impl Freeze for DeclareKind
impl RefUnwindSafe for DeclareKind
impl Send for DeclareKind
impl Sync for DeclareKind
impl Unpin for DeclareKind
impl UnwindSafe for DeclareKind
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