pub struct NetGuard {
pub policy: Option<Arc<dyn NetPolicy>>,
pub block_metadata: bool,
pub block_private: bool,
}Expand description
Per-request network policy. Default (no policy, all-false) is
inert — a caller that sets nothing keeps the cached-client fast path.
Fields§
§policy: Option<Arc<dyn NetPolicy>>The net grant in force. None ⇒ any host; Some ⇒ its check
must pass for the initial URL and every redirect hop.
block_metadata: boolBlock the cloud instance-metadata endpoints (169.254.169.254 /
fd00:ec2::254) at both the URL and the resolved-address layer.
block_private: boolAlso block loopback / RFC1918 / link-local / ULA / CGNAT. Off by
default so local servers on 127.0.0.1 still work; a host opts in.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for NetGuard
impl !UnwindSafe for NetGuard
impl Freeze for NetGuard
impl Send for NetGuard
impl Sync for NetGuard
impl Unpin for NetGuard
impl UnsafeUnpin for NetGuard
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