pub enum Permission {
Show 32 variants
Dofile,
Load,
Loadfile,
Require,
OsExecute,
OsExit,
OsGetenv,
OsRemove,
OsRename,
OsSetenv,
IoOpen,
IoRead,
IoWrite,
IoPopen,
DebugGetinfo,
DebugGetlocal,
DebugGetmetatable,
DebugGetregistry,
DebugGetupvalue,
DebugGetuservalue,
DebugSethook,
DebugSetlocal,
DebugSetupvalue,
DebugSetuservalue,
PackageLoadlib,
PackagePath,
PackageLoaded,
PackagePreload,
PackageSearchpath,
MathRandom,
MathRandomseed,
StringDump,
}Expand description
权限类型枚举 - 对应所有危险的 Lua API
Variants§
Dofile
Load
Loadfile
Require
OsExecute
OsExit
OsGetenv
OsRemove
OsRename
OsSetenv
IoOpen
IoRead
IoWrite
IoPopen
DebugGetinfo
DebugGetlocal
DebugGetmetatable
DebugGetregistry
DebugGetupvalue
DebugGetuservalue
DebugSethook
DebugSetlocal
DebugSetupvalue
DebugSetuservalue
PackageLoadlib
PackagePath
PackageLoaded
PackagePreload
PackageSearchpath
MathRandom
MathRandomseed
StringDump
Implementations§
Source§impl Permission
impl Permission
Sourcepub fn risk_level(&self) -> RiskLevel
pub fn risk_level(&self) -> RiskLevel
获取权限对应的风险等级
Sourcepub fn description(&self) -> &'static str
pub fn description(&self) -> &'static str
获取权限的风险描述
pub fn query_auth(func_name: &str) -> Option<Permission>
Trait Implementations§
Source§impl Clone for Permission
impl Clone for Permission
Source§fn clone(&self) -> Permission
fn clone(&self) -> Permission
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Permission
impl Debug for Permission
Source§impl<'de> Deserialize<'de> for Permission
impl<'de> Deserialize<'de> for Permission
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Permission
Source§impl Hash for Permission
impl Hash for Permission
Source§impl PartialEq for Permission
impl PartialEq for Permission
Source§fn eq(&self, other: &Permission) -> bool
fn eq(&self, other: &Permission) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for Permission
impl Serialize for Permission
impl StructuralPartialEq for Permission
Auto Trait Implementations§
impl Freeze for Permission
impl RefUnwindSafe for Permission
impl Send for Permission
impl Sync for Permission
impl Unpin for Permission
impl UnsafeUnpin for Permission
impl UnwindSafe for Permission
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more