Skip to main content

HelperService

Trait HelperService 

Source
pub trait HelperService: Sized {
Show 14 methods // Required methods async fn route_add( self, context: Context, subnet: String, iface: String, ) -> Result<(), String>; async fn route_remove( self, context: Context, subnet: String, ) -> Result<(), String>; async fn dns_install( self, context: Context, domain: String, port: u16, ) -> Result<(), String>; async fn dns_uninstall( self, context: Context, domain: String, ) -> Result<(), String>; async fn dns_status( self, context: Context, domain: String, ) -> Result<bool, String>; async fn socket_link( self, context: Context, target: String, ) -> Result<(), String>; async fn socket_unlink(self, context: Context) -> Result<(), String>; async fn cli_link( self, context: Context, name: String, target: String, ) -> Result<(), String>; async fn cli_unlink( self, context: Context, name: String, ) -> Result<(), String>; async fn version(self, context: Context) -> String; async fn hosts_alias_install(self, context: Context) -> Result<(), String>; async fn hosts_alias_uninstall(self, context: Context) -> Result<(), String>; async fn hosts_alias_status(self, context: Context) -> Result<bool, String>; // Provided method fn serve(self) -> ServeHelperService<Self> { ... }
}
Expand description

The tarpc service definition for privileged host mutations.

All methods perform input validation server-side before executing any privileged operation. Results carry error strings on failure.

Required Methods§

Source

async fn route_add( self, context: Context, subnet: String, iface: String, ) -> Result<(), String>

Adds a host route for subnet via iface. Idempotent: returns Ok if the route already exists.

Source

async fn route_remove( self, context: Context, subnet: String, ) -> Result<(), String>

Removes the host route for subnet. Idempotent: returns Ok if the route is already absent.

Source

async fn dns_install( self, context: Context, domain: String, port: u16, ) -> Result<(), String>

Installs a DNS resolver file for domain pointing to 127.0.0.1:port.

Source

async fn dns_uninstall( self, context: Context, domain: String, ) -> Result<(), String>

Removes the DNS resolver file for domain.

Source

async fn dns_status( self, context: Context, domain: String, ) -> Result<bool, String>

Checks if a DNS resolver file is installed for domain.

Creates /var/run/docker.sock symlink pointing to target.

Removes the /var/run/docker.sock symlink.

Creates /usr/local/bin/{name} symlink pointing to target. Used to expose Docker CLI tools from the app bundle.

Removes /usr/local/bin/{name} symlink if it points inside an ArcBox bundle.

Source

async fn version(self, context: Context) -> String

Returns the helper version string.

Source

async fn hosts_alias_install(self, context: Context) -> Result<(), String>

Appends the fixed 127.0.0.1 ArcBox alias to /etc/hosts so the guest-data NFS mount can use ArcBox:/ as its source (Finder shows a mount by its source host name). Takes no arguments — the helper never writes caller-controlled hosts entries.

Source

async fn hosts_alias_uninstall(self, context: Context) -> Result<(), String>

Removes the ArcBox alias line from /etc/hosts.

Source

async fn hosts_alias_status(self, context: Context) -> Result<bool, String>

Checks whether the ArcBox /etc/hosts alias is installed.

Provided Methods§

Source

fn serve(self) -> ServeHelperService<Self>

Returns a serving function to use with InFlightRequest::execute.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§