pub struct HostScope { /* private fields */ }Expand description
Restricts network operations to a set of allowed host prefixes.
Targets are matched by string prefix — "api.example.com" matches
both "api.example.com:443" and "api.example.com/path".
§Example
let scope = HostScope::new(["api.example.com", "cdn.example.com"]);
assert!(scope.check("api.example.com:443").is_ok());
assert!(scope.check("evil.com:8080").is_err());Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HostScope
impl RefUnwindSafe for HostScope
impl Send for HostScope
impl Sync for HostScope
impl Unpin for HostScope
impl UnsafeUnpin for HostScope
impl UnwindSafe for HostScope
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