Struct conductor::Override
[−]
[src]
pub struct Override { /* fields omitted */ }
An Override
is a collection of extensions to a project's basic pods.
Overrides are typically used to represent deployment environments: test,
development and production.
(Right now, this is deliberately a very thin wrapper around the name
field, suitable for use as key in a BTreeMap
. If you add more
fields, you'll probably need to remove PartialEq
, Eq
, PartialOrd
,
Ord
from the derive
list, and either implement them manually or
redesign the code that uses overrides as hash table keys.)
Methods
impl Override
[src]
fn new<S>(name: S) -> Override where S: Into<String>
Create a new override with the specified name.
fn name(&self) -> &str
Get the name of this override.
fn is_enabled_by(&self, enable_in_overrides: &Option<Vec<String>>) -> bool
Check to see if this override should be included in some operation,
given an optional enable_in_overrides
overrides list. If no list
is supplied, we'll act as those we were passed a default list
including all overrides except test
.
We have a weird calling convention because our typical callers are
invoking us using a member field of a Config
struct that they
own.
let ovr = conductor::Override::new("development"); assert!(ovr.is_enabled_by(&None)); assert!(ovr.is_enabled_by(&Some(vec!["development".to_owned()]))); assert!(!ovr.is_enabled_by(&Some(vec!["production".to_owned()]))); let test_ovr = conductor::Override::new("test"); assert!(!test_ovr.is_enabled_by(&None));Run
fn compose_project_name(&self, project: &Project) -> String
Get a value for docker-compose
's -p
argument for a given project.
Trait Implementations
impl Debug for Override
[src]
impl Clone for Override
[src]
fn clone(&self) -> Override
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl PartialEq for Override
[src]
fn eq(&self, __arg_0: &Override) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Override) -> bool
This method tests for !=
.
impl Eq for Override
[src]
impl PartialOrd for Override
[src]
fn partial_cmp(&self, __arg_0: &Override) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Override) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Override) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Override) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Override) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more