pub trait PathPolicy:
Send
+ Sync
+ 'static {
// Required method
fn resolve(&self, path: &Path, op: PathOp) -> Result<FsAccess, PolicyError>;
// Provided method
fn policy_name(&self) -> &'static str { ... }
}Expand description
Policy that decides whether a given path may be accessed.
Every filesystem-touching function in mlua-batteries calls
PathPolicy::resolve before performing I/O.
Required Methods§
Provided Methods§
Sourcefn policy_name(&self) -> &'static str
fn policy_name(&self) -> &'static str
Human-readable name for this policy, used in Debug output.
The default implementation returns std::any::type_name of the
concrete type, which works correctly even through trait objects
because the vtable dispatches to the concrete implementation.