Skip to main content

HostPaths

Struct HostPaths 

Source
pub struct HostPaths {
    pub active_setup: PathBuf,
    pub backup: PathBuf,
    pub docker: PathBuf,
    pub etc: PathBuf,
    pub lease_file: PathBuf,
}
Expand description

Default host layout used on a Horto box (/srv/...).

Tests and dry-run hosts override these with a temporary tree.

§Examples

use horto_os_ui_shared::HostPaths;
use std::path::PathBuf;

let paths = HostPaths {
    active_setup: PathBuf::from("/tmp/active"),
    backup: PathBuf::from("/tmp/backup"),
    docker: PathBuf::from("/tmp/docker"),
    etc: PathBuf::from("/tmp/etc"),
    lease_file: PathBuf::from("/tmp/leases"),
};
assert!(paths.resume_file().ends_with("horto_setup_state.json"));

Fields§

§active_setup: PathBuf

/srv/active_setup (env files, staging, resume).

§backup: PathBuf

/srv/backup.

§docker: PathBuf

/srv/docker.

§etc: PathBuf

/etc (or a tempfile stand-in in tests).

§lease_file: PathBuf

dnsmasq leases file.

Implementations§

Source§

impl HostPaths

Source

pub fn resume_file(&self) -> PathBuf

Resume JSON path under active_setup.

Source

pub fn full_env_file(&self) -> PathBuf

IoT-LAN env file (iot-lan_conf.env).

Source

pub fn iot_lan_env_file(&self) -> PathBuf

Alias for Self::full_env_file (tip name).

Source

pub fn minimal_env_file(&self) -> PathBuf

Minimal setup env file.

Source

pub fn os_configuration_file(&self) -> PathBuf

OS configuration env under active setup.

Status-API service links (host/ports). Overrides embedded defaults when present.

Source

pub fn staging_etc(&self) -> PathBuf

Staged /etc tree before apply (s4s5).

Source

pub fn initial_backup_etc(&self) -> PathBuf

Protected initial /etc backup destination (s3).

Source

pub fn docker_assets(&self) -> PathBuf

Docker assets directory (leases export, stack files).

Source

pub fn leases_json(&self) -> PathBuf

Exported leases JSON path.

Source

pub fn leases_html(&self) -> PathBuf

Exported leases HTML path.

Trait Implementations§

Source§

impl Clone for HostPaths

Source§

fn clone(&self) -> HostPaths

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 HostPaths

Source§

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

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

impl Default for HostPaths

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<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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more