pub struct Admission {
pub allowed_paths: &'static [&'static str],
pub denied_paths: &'static [&'static str],
}Expand description
Dependency admission for objects produced outside the current registry tree. 当前注册树对外部注册机产物的依赖门禁。
Fields§
§allowed_paths: &'static [&'static str]External path prefixes admitted; empty admits every path not denied. 允许进入的外部路径前缀;为空时允许所有未被拒绝的路径。
denied_paths: &'static [&'static str]External path prefixes refused; a denial overrides any allowance. 拒绝进入的外部路径前缀;拒绝优先于允许。
Implementations§
Source§impl Admission
impl Admission
Sourcepub const fn new(
allowed_paths: &'static [&'static str],
denied_paths: &'static [&'static str],
) -> Admission
pub const fn new( allowed_paths: &'static [&'static str], denied_paths: &'static [&'static str], ) -> Admission
Build an admission from explicit allow and deny path prefixes. 用显式的允许与拒绝路径前缀构造门禁。
Sourcepub const fn allow_paths(paths: &'static [&'static str]) -> Admission
pub const fn allow_paths(paths: &'static [&'static str]) -> Admission
Admission allowing only paths under the listed prefixes. 只允许列出的前缀之下的路径进入的门禁。
Sourcepub fn accepts(self, path: &str) -> bool
pub fn accepts(self, path: &str) -> bool
Whether an external path may enter: denied prefixes win, and an empty allow list admits every path not denied. 外部路径是否可以进入:拒绝前缀优先,允许列表为空时接受所有未被拒绝的路径。
Sourcepub fn into_owned(self) -> OwnedAdmission
pub fn into_owned(self) -> OwnedAdmission
Copy this admission into the owned form a snapshot can retain. 将该门禁复制为快照可长期持有的拥有所有权形式。
Trait Implementations§
impl Copy for Admission
impl Eq for Admission
impl StructuralPartialEq for Admission
Auto Trait Implementations§
impl Freeze for Admission
impl RefUnwindSafe for Admission
impl Send for Admission
impl Sync for Admission
impl Unpin for Admission
impl UnsafeUnpin for Admission
impl UnwindSafe for Admission
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