pub struct PathRestriction {
pub root_dir: PathBuf,
pub allow_absolute: bool,
pub allow_parent_traversal: bool,
pub allowed_extensions: Option<HashSet<String>>,
}Expand description
路径限制规则
Fields§
§root_dir: PathBuf根目录(路径必须在此之下)
allow_absolute: bool是否允许绝对路径
allow_parent_traversal: bool是否允许 .. 路径遍历
allowed_extensions: Option<HashSet<String>>允许的文件扩展名白名单(None 表示不限制)
Trait Implementations§
Source§impl Clone for PathRestriction
impl Clone for PathRestriction
Source§fn clone(&self) -> PathRestriction
fn clone(&self) -> PathRestriction
Returns a duplicate of the value. Read more
1.0.0 · 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 PathRestriction
impl Debug for PathRestriction
Auto Trait Implementations§
impl Freeze for PathRestriction
impl RefUnwindSafe for PathRestriction
impl Send for PathRestriction
impl Sync for PathRestriction
impl Unpin for PathRestriction
impl UnwindSafe for PathRestriction
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