Skip to main content

HostFacts

Struct HostFacts 

Source
pub struct HostFacts {
    pub subids: SubIds,
    pub pools: Vec<String>,
    pub path_map: Option<(String, String)>,
    pub initial_copy: bool,
    pub incus_version: Option<String>,
    pub invoking_ids: (u32, u32),
    pub shared_root: Option<String>,
    pub org: Option<OrgId>,
    pub registry: Option<String>,
    pub project: String,
}
Expand description

Facts about the host that resolution depends on.

Fields§

§subids: SubIds§pools: Vec<String>

Storage pools that exist, in server order.

§path_map: Option<(String, String)>

Rewrite bind sources starting with .0 to start with .1 instead: the path incusd resolves can differ from the one this process sees (see HostFacts::detect_path_map).

§initial_copy: bool

The server can seed a new volume from the image (disk_initial_copy).

§incus_version: Option<String>

The incus server version (environment.server_version).

§invoking_ids: (u32, u32)

The (uid, gid) of the user running isb: what a VM’s bind mounts map to.

§shared_root: Option<String>

The only directory incusd can see bind sources under, when it runs elsewhere: on macOS, the home directory shared with the isb machine.

§org: Option<OrgId>

The org the sandbox goes in (from the client’s incus project): where registry: images resolve. None outside isb’s projects.

§registry: Option<String>

The local registry’s host:port, when one is set up.

§project: String

The incus project the sandbox goes in (its egress network is named from it).

Implementations§

Source§

impl HostFacts

Source

pub fn detect_path_map() -> Option<(String, String)>

Where bind sources must be translated before incusd sees them.

ISB_HOST_PATH_MAP=from=to sets it explicitly. Otherwise, inside an agent-workspace box, $HOME is a bind mount of a directory on the box’s own host and incusd resolves disk sources in its own mount view, where only the host-side path exists; the box publishes that path in /etc/workspace/guest-home. Without the rewrite, adding the device fails with “Missing source path” for a directory ls lists happily.

Source

pub fn translate(&self, path: &str) -> String

Source

pub fn pick_pool(&self, requested: Option<&str>) -> Result<String>

auto: incus-zfs, else default, else the first pool.

Trait Implementations§

Source§

impl Clone for HostFacts

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HostFacts

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for HostFacts

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V