pub struct LocalNetwork { /* private fields */ }Expand description
This process’s own network, under the deployment’s egress policy.
Implementations§
Source§impl LocalNetwork
impl LocalNetwork
pub fn new(allowed_domains: Vec<String>, agent_offline: bool) -> Self
Sourcepub fn with_user_agent(self, user_agent: impl Into<Arc<str>>) -> Self
pub fn with_user_agent(self, user_agent: impl Into<Arc<str>>) -> Self
Requests that name no User-Agent send user_agent
(base::paths::Layout::user_agent).
Sourcepub fn for_agent_policy(mode: NetworkMode, allowed_domains: Vec<String>) -> Self
pub fn for_agent_policy(mode: NetworkMode, allowed_domains: Vec<String>) -> Self
The egress a deployment’s sandbox.network.mode describes, read the
same way the sandbox backends read it so the two cannot disagree about
where the model may reach.
Under Unrestricted the domain list restricts nothing, but a host it
names may still be reached at an internal address — the one thing the
list says in that mode is “these are mine”. Proxy binds a sandboxed
command, not the model’s own requests, which are read as under
Unrestricted.
Trait Implementations§
Source§impl Default for LocalNetwork
impl Default for LocalNetwork
Source§impl Network for LocalNetwork
impl Network for LocalNetwork
Source§fn permits(&self, host: &str, origin: Origin) -> bool
fn permits(&self, host: &str, origin: Origin) -> bool
The allowlist, and for an address written out, whether it is internal. A name’s addresses are only known once it is resolved, at send.
Auto Trait Implementations§
impl !RefUnwindSafe for LocalNetwork
impl !UnwindSafe for LocalNetwork
impl Forget for LocalNetwork
impl Freeze for LocalNetwork
impl Move for LocalNetwork
impl Send for LocalNetwork
impl Sync for LocalNetwork
impl Unpin for LocalNetwork
impl UnsafeUnpin for LocalNetwork
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