Add FnAccess methods.

This commit is contained in:
Stephen Chung
2022-07-21 09:33:49 +08:00
parent 747cd903b4
commit 6bc0118074
2 changed files with 22 additions and 0 deletions

View File

@@ -14,6 +14,27 @@ pub enum FnAccess {
Public,
}
impl FnAccess {
/// Is this function private?
#[inline(always)]
#[must_use]
pub fn is_private(self) -> bool {
match self {
Self::Private => true,
Self::Public => false,
}
}
/// Is this function public?
#[inline(always)]
#[must_use]
pub fn is_public(self) -> bool {
match self {
Self::Private => false,
Self::Public => true,
}
}
}
bitflags! {
/// _(internals)_ Bit-flags containing [`AST`][crate::AST] node configuration options.
/// Exported under the `internals` feature only.