Skip to main content

Environment

Struct Environment 

Source
pub struct Environment {
Show 16 fields pub name: String, pub target: Target, pub instance: Option<u8>, pub networks: IndexMap<String, NetworkPlan>, pub outside: IndexMap<String, OutsideNetwork>, pub router: Option<IndexMap<String, Ipv4Addr>>, pub router6: IndexMap<String, Ipv6Addr>, pub machines: IndexMap<String, MachinePlan>, pub start_order: Vec<String>, pub checks: Vec<Resolved>, pub controller: Option<Controller>, pub constraints: Option<Constraints>, pub requirements: Vec<Requirement>, pub images: Images, pub inventory_groups: IndexMap<String, Vec<String>>, pub private_dns: Option<PrivateDns>, /* private fields */
}
Expand description

One environment, planned for one target.

Fields§

§name: String

The environment’s name (Compose project, resource prefix).

§target: Target

The target it is planned for.

§instance: Option<u8>

The instance number, when several copies of the environment run side by side.

§networks: IndexMap<String, NetworkPlan>

Its networks, in spec order.

§outside: IndexMap<String, OutsideNetwork>

The networks outside the environment (external, bridged), in spec order: never in Environment::networks nor in the spec the backends read.

§router: Option<IndexMap<String, Ipv4Addr>>

Isoloom’s router, when reach rules need one: its address on each network it routes.

§router6: IndexMap<String, Ipv6Addr>

The router’s IPv6 address on each IPv6 network it routes (empty without a router).

§machines: IndexMap<String, MachinePlan>

Its machines, in spec order.

§start_order: Vec<String>

Machine names, each after the machines it waits for.

§checks: Vec<Resolved>

The checks, resolved to positions and probes.

§controller: Option<Controller>

The controller VM running playbooks, when the environment needs one.

§constraints: Option<Constraints>

The spec’s constraints (proxy, mirrors, registries, NTP), when it has any.

§requirements: Vec<Requirement>

What the environment asks of the backend rendering it.

§images: Images

The image references to pull, through the registry mirrors.

§inventory_groups: IndexMap<String, Vec<String>>

The Ansible inventory groups and their members (see ansible::groups).

§private_dns: Option<PrivateDns>

The private DNS zone, when dns.private is on: its domain and records.

Implementations§

Source§

impl Environment

Source

pub fn build(spec: &Spec, target: Target, instance: Option<u8>) -> Environment

Plans a validated spec for target (instance: the copy it is, when several run).

Source

pub fn spec(&self) -> &Spec

The spec as laid out for the target, for what the plan doesn’t model yet.

Source

pub fn address_for(&self, from: &str, to: &str) -> Ipv4Addr

The address from reaches to at: on a network they share, else to’s first.

Source

pub fn probe_address(&self, name: &str, network: &str) -> String

Where a probe reaches machine name on network: its IPv4 address, or on an IPv6-only network its IPv6 one. Its name, which the target’s DNS resolves, when it has no address there: on an IPv6-only network that leaves addresses to the target (or a machine or a network the plan doesn’t hold, which no check of the plan names).

Trait Implementations§

Source§

impl Clone for Environment

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 Environment

Source§

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

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

impl PartialEq for Environment

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Environment

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