use bitflags::bitflags;
#[cfg(feature = "no_std")]
use std::prelude::v1::*;
#[derive(Debug, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[cfg_attr(
feature = "serde",
derive(serde::Serialize, serde::Deserialize),
serde(rename_all = "camelCase")
)]
#[non_exhaustive]
pub enum FnAccess {
Private,
Public,
}
impl FnAccess {
#[inline(always)]
#[must_use]
pub const fn is_private(self) -> bool {
match self {
Self::Private => true,
Self::Public => false,
}
}
#[inline(always)]
#[must_use]
pub const fn is_public(self) -> bool {
match self {
Self::Private => false,
Self::Public => true,
}
}
}
bitflags! {
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
pub struct ASTFlags: u8 {
const CONSTANT = 0b_0000_0001;
const EXPORTED = 0b_0000_0010;
const NEGATED = 0b_0000_0100;
const BREAK = 0b_0000_1000;
}
}
impl ASTFlags {
pub const NONE: Self = Self::empty();
}
impl std::fmt::Debug for ASTFlags {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", &self.0)
}
}