pub struct Client { /* private fields */ }Expand description
Client for the arcbox-helper privileged daemon.
Implementations§
Source§impl Client
impl Client
Sourcepub async fn connect() -> Result<Self, ClientError>
pub async fn connect() -> Result<Self, ClientError>
Connects to the helper daemon via Unix socket.
Uses launchd-managed socket by default (/var/run/arcbox-helper.sock),
overridable via ARCBOX_HELPER_SOCKET env var.
Sourcepub async fn connect_to(path: &str) -> Result<Self, ClientError>
pub async fn connect_to(path: &str) -> Result<Self, ClientError>
Connects to the helper daemon at an explicit socket path.
Unlike connect(), this does not read the
ARCBOX_HELPER_SOCKET env var, making it safe for parallel tests.
Sourcepub async fn route_add(
&self,
subnet: &str,
iface: &str,
) -> Result<(), ClientError>
pub async fn route_add( &self, subnet: &str, iface: &str, ) -> Result<(), ClientError>
Adds a host route for subnet via iface.
Sourcepub async fn route_remove(&self, subnet: &str) -> Result<(), ClientError>
pub async fn route_remove(&self, subnet: &str) -> Result<(), ClientError>
Removes the host route for subnet.
Sourcepub async fn dns_install(
&self,
domain: &str,
port: u16,
) -> Result<(), ClientError>
pub async fn dns_install( &self, domain: &str, port: u16, ) -> Result<(), ClientError>
Installs a DNS resolver file for domain on port port.
Sourcepub async fn dns_uninstall(&self, domain: &str) -> Result<(), ClientError>
pub async fn dns_uninstall(&self, domain: &str) -> Result<(), ClientError>
Removes the DNS resolver file for domain.
Sourcepub async fn dns_status(&self, domain: &str) -> Result<bool, ClientError>
pub async fn dns_status(&self, domain: &str) -> Result<bool, ClientError>
Checks if a DNS resolver file is installed for domain.
Sourcepub async fn hosts_alias_install(&self) -> Result<(), ClientError>
pub async fn hosts_alias_install(&self) -> Result<(), ClientError>
Appends the fixed 127.0.0.1 ArcBox alias to /etc/hosts.
Sourcepub async fn hosts_alias_uninstall(&self) -> Result<(), ClientError>
pub async fn hosts_alias_uninstall(&self) -> Result<(), ClientError>
Removes the ArcBox alias line from /etc/hosts.
Sourcepub async fn hosts_alias_status(&self) -> Result<bool, ClientError>
pub async fn hosts_alias_status(&self) -> Result<bool, ClientError>
Checks whether the ArcBox /etc/hosts alias is installed.
Sourcepub async fn socket_link(&self, target: &str) -> Result<(), ClientError>
pub async fn socket_link(&self, target: &str) -> Result<(), ClientError>
Creates the /var/run/docker.sock → target symlink.
Sourcepub async fn socket_unlink(&self) -> Result<(), ClientError>
pub async fn socket_unlink(&self) -> Result<(), ClientError>
Removes the /var/run/docker.sock symlink.
Sourcepub async fn cli_link(
&self,
name: &str,
target: &str,
) -> Result<(), ClientError>
pub async fn cli_link( &self, name: &str, target: &str, ) -> Result<(), ClientError>
Creates /usr/local/bin/{name} → target symlink.
Sourcepub async fn cli_unlink(&self, name: &str) -> Result<(), ClientError>
pub async fn cli_unlink(&self, name: &str) -> Result<(), ClientError>
Removes /usr/local/bin/{name} symlink if ArcBox-owned.
Sourcepub async fn version(&self) -> Result<String, ClientError>
pub async fn version(&self) -> Result<String, ClientError>
Returns the helper daemon version.