Struct cage::Target [] [src]

pub struct Target { /* fields omitted */ }

An Target provides collection of extensions to a project's basic pods. Targets 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 targets as hash table keys.)

Methods

impl Target
[src]

Create a new target with the specified name.

Get the name of this target.

Check to see if this target should be included in some operation, given an optional enable_in_targets targets list. If no list is supplied, we'll act as those we were passed a default list including all targets 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 target = cage::Target::new("development");
assert!(target.is_enabled_by(&None));
assert!(target.is_enabled_by(&Some(vec!["development".to_owned()])));
assert!(!target.is_enabled_by(&Some(vec!["production".to_owned()])));

let test_target = cage::Target::new("test");
assert!(!test_target.is_enabled_by(&None));

Get a value for docker-compose's -p argument for a given project.

Trait Implementations

impl Debug for Target
[src]

Formats the value using the given formatter.

impl Clone for Target
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Target
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Target
[src]

impl PartialOrd for Target
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Ord for Target
[src]

This method returns an Ordering between self and other. Read more