#[non_exhaustive]pub struct Devices {Show 22 fields
pub kvm: PathBuf,
pub etc_group: PathBuf,
pub proc_modules: PathBuf,
pub kernel_release: PathBuf,
pub lib_modules: PathBuf,
pub kvm_virt_at_load: PathBuf,
pub sys_module: PathBuf,
pub modprobe_d: PathBuf,
pub applications: PathBuf,
pub docker_desktop_socket: PathBuf,
pub docker_desktop_settings: Vec<PathBuf>,
pub utm_app: PathBuf,
pub hyperv_service: PathBuf,
pub vmware_utility: PathBuf,
pub vmware_utility_service: SocketAddr,
pub vmrun: Vec<PathBuf>,
pub prlctl: Vec<PathBuf>,
pub vhost_user: Vec<PathBuf>,
pub virtiofsd: Vec<PathBuf>,
pub netstat: Vec<PathBuf>,
pub ovftool: Vec<PathBuf>,
pub rosetta_runtime: PathBuf,
}Expand description
The files and the one local service detection reads instead of running a tool: each a path a
test points into a folder of its own (Devices::under), so no test reads the machine running
it.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kvm: PathBufKVM’s device (/dev/kvm), which libvirt’s and QEMU’s guests run on (Linux).
etc_group: PathBufThe group database (/etc/group): the name of the group /dev/kvm belongs to.
proc_modules: PathBufThe kernel modules loaded (/proc/modules): VirtualBox’s driver, KVM’s CPU module.
kernel_release: PathBufThe running kernel’s release (/proc/sys/kernel/osrelease, what uname -r says).
lib_modules: PathBufThe kernels’ module folders (/lib/modules), each with a build link once its headers
are installed.
kvm_virt_at_load: PathBufKVM’s enable_virt_at_load parameter (/sys/module/kvm/parameters/enable_virt_at_load,
Linux 6.12 and later).
sys_module: PathBufThe loaded modules’ folders (/sys/module): each loadable module’s refcnt (how many
hold it) and holders (the modules among them).
modprobe_d: PathBufThe folder of the options modprobe gives a module as it loads it (/etc/modprobe.d, its
*.conf files).
applications: PathBufThe Applications folder macOS apps install into (/Applications): a tool’s app bundle
(crate::install::ToolRow::mac_app) is looked for there, and Docker Desktop’s own
docker CLI inside its bundle.
docker_desktop_socket: PathBufDocker Desktop’s socket (~/.docker/run/docker.sock, macOS), which listens once its
backend runs: never, while Docker Desktop waits for its user in its own window.
docker_desktop_settings: Vec<PathBuf>Docker Desktop’s settings files, the first there read: settings-store.json, then the
settings.json of a Docker Desktop before 4.34 (~/Library/Group Containers/ group.com.docker on macOS, %APPDATA%\Docker on Windows, ~/.docker/desktop on Linux).
They record the version of the agreement its user accepted in its window
(crate::docker::agreement_accepted).
utm_app: PathBufUTM’s app bundle (macOS): in /Applications, else in the user’s own ~/Applications (an
install without an administrator’s password); /Applications/UTM.app when in neither.
hyperv_service: PathBufHyper-V’s Virtual Machine Management service (%SystemRoot%\System32\vmms.exe), there
once the Windows feature is on.
vmware_utility: PathBufWhat proves HashiCorp’s Vagrant VMware Utility is installed: its program on macOS and
Linux, the certificates its installer generates (under %ProgramData%) on Windows.
vmware_utility_service: SocketAddrWhere the Vagrant VMware Utility’s service answers when it runs: this machine’s port 9922,
the plugin’s default (utility_port).
vmrun: Vec<PathBuf>Where VMware’s apps install vmrun, looked at when it isn’t on PATH: Fusion’s
Contents/Public/vmrun in /Applications, then in ~/Applications (macOS); Workstation’s
folder under %ProgramFiles(x86)%, then %ProgramFiles% (Windows).
prlctl: Vec<PathBuf>Where Parallels Desktop installs prlctl, looked at when it isn’t on PATH: the app’s
Contents/MacOS/prlctl in /Applications, then in ~/Applications.
vhost_user: Vec<PathBuf>The folders libvirt reads QEMU’s vhost-user descriptors from, in its order, a later
folder’s file taking the place of an earlier one’s of the same name: the distribution’s
(/usr/share/qemu/vhost-user), then an administrator’s (/etc/qemu/vhost-user) (Linux).
virtiofsd: Vec<PathBuf>Where vagrant-qemu looks for the virtiofsd it shares folders through, in its order:
virtiofsd in each folder of PATH, then /usr/libexec/virtiofsd, then
/usr/lib/qemu/virtiofsd (Linux).
netstat: Vec<PathBuf>Where vagrant-vmware-desktop looks for the netstat it reads the routing table with before
it makes a private network (its collision check): netstat in each folder of PATH
(Linux; macOS has it in /usr/sbin, Windows reads its routes otherwise).
ovftool: Vec<PathBuf>Where VMware’s hypervisors keep their own OVF Tool (ovftool), in the order to look:
Fusion’s Contents/Library/VMware OVF Tool in /Applications, then in ~/Applications
(macOS); Workstation’s OVFTool folder under %ProgramFiles(x86)%, then %ProgramFiles%
(Windows). Workstation for Linux puts it in /usr/bin, on PATH.
rosetta_runtime: PathBufRosetta 2’s runtime (/Library/Apple/usr/libexec/oah/libRosettaRuntime), there once it is
installed (macOS on Apple silicon).
Implementations§
Source§impl Devices
impl Devices
Sourcepub fn under(root: &Path) -> Devices
pub fn under(root: &Path) -> Devices
Each one under the folder root, where a test makes the ones it is about (root/dev/kvm,
root/proc/modules, root/Applications/UTM.app…), none of which exist until it does;
the VMware Utility’s service at port 0 of this machine, which nothing answers. The apps’
tools (the hypervisors’ OVF Tools too) are under root and root/home (macOS’s), and
root/Program Files (x86) and root/Program Files (Workstation’s); Rosetta’s runtime
under root; libvirt’s descriptor folders and vagrant-qemu’s
virtiofsd fallbacks under root, with no PATH folder before them; netstat as
root/usr/bin/netstat.
Source§impl Devices
impl Devices
Sourcepub fn app_tool(&self, program: &str) -> Vec<&Path>
pub fn app_tool(&self, program: &str) -> Vec<&Path>
Where an app installs program off PATH (Devices::vmrun, Devices::prlctl), in
the order to look; none for a tool no app here installs.
Trait Implementations§
impl Eq for Devices
impl StructuralPartialEq for Devices
Auto Trait Implementations§
impl Forget for Devices
impl Freeze for Devices
impl Move for Devices
impl RefUnwindSafe for Devices
impl Send for Deviceswhere
RawVecInner: Send,
impl Sync for Deviceswhere
RawVecInner: Sync,
impl Unpin for Devices
impl UnsafeUnpin for Deviceswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<PathBuf>: UnsafeUnpin,
impl UnwindSafe for Deviceswhere
RawVecInner: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.