Add FnAccess methods.
This commit is contained in:
parent
747cd903b4
commit
6bc0118074
@ -32,6 +32,7 @@ Enhancements
|
||||
* `EvalContext::eval_expression_tree_raw` and `Expression::eval_with_context_raw` are added to allow for not rewinding the `Scope` at the end of a statements block.
|
||||
* A new `range` function variant that takes an exclusive range with a step.
|
||||
* `as_string` is added to BLOB's to convert it into a string by interpreting it as a UTF-8 byte stream.
|
||||
* `FnAccess::is_private` and `FnAccess::is_public` are added for convenience.
|
||||
|
||||
|
||||
Version 1.8.0
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user