[][src]Struct cage::Project

pub struct Project { /* fields omitted */ }

A cage project, which is represented as a directory containing a pods subdirectory.

Implementations

impl Project[src]

pub fn from_current_dir() -> Result<Project>[src]

Create a Project using the pre-existing project files in the current directory as input and the .cage subdirectory as output.

pub fn name(&self) -> &str[src]

The name of this project. This defaults to the name of the current directory.

pub fn set_name(&mut self, name: &str) -> &mut Project[src]

Set the name of this project. This should be done before calling output or any methods in cmd.

pub fn compose_name(&self) -> String[src]

Get that name that docker_compose would use for this project.

pub fn root_dir(&self) -> &Path[src]

The root directory of this project.

pub fn src_dir(&self) -> &Path[src]

The source directory of this project, where we can put cloned git repositories, and where our local source trees are typically found.

pub fn output_dir(&self) -> &Path[src]

The output directory of this project. Normally .cage inside the root_dir, but it may be targetn.

pub fn pods_dir(&self) -> PathBuf[src]

The directory in which are pods are defined, and relative to which all docker-compose.yml paths should be interpreted.

pub fn output_pods_dir(&self) -> PathBuf[src]

The path relative to which our pods will be output. This can be joined with Pod::rel_path to get an output path for a specific pod.

pub fn pods(&self) -> Pods<'_>

Notable traits for Pods<'a>

impl<'a> Iterator for Pods<'a> type Item = &'a Pod;
[src]

Iterate over all pods in this project.

pub fn pod(&self, name: &str) -> Option<&Pod>[src]

Look up the named pod.

pub fn service<'a>(&self, name: &'a str) -> Option<(&Pod, &str)>[src]

Look up the named service. Returns the pod containing the service and the name of the service within that pod.

pub fn service_or_err<'a>(&self, name: &'a str) -> Result<(&Pod, &str)>[src]

Like service, but returns an error if the service is unknown.

pub fn pod_or_service<'a, 'b>(
    &'a self,
    name: &'b str
) -> Option<PodOrService<'a>>
[src]

Look for a name as a pod first, and if that fails, look for it as a service.

pub fn pod_or_service_or_err<'a, 'b>(
    &'a self,
    name: &'b str
) -> Result<PodOrService<'a>>
[src]

Like pod_or_service, but returns an error if no pod or service of that name can be found.

pub fn targets(&self) -> Targets<'_>

Notable traits for Targets<'a>

impl<'a> Iterator for Targets<'a> type Item = &'a Target;
[src]

Iterate over all targets in this project.

pub fn target(&self, name: &str) -> Option<&Target>[src]

Look up the named target. We name this function target instead of target to avoid a keyword clash.

pub fn target_or_err(&self, name: &str) -> Result<&Target>[src]

Like target, but returns an error if no each target is found.

pub fn current_target(&self) -> &Target[src]

Get the current target that we're using with this project.

pub fn set_current_target_name(&mut self, name: &str) -> Result<()>[src]

Set the name of the target to use. This must be done before calling output or export.

pub fn sources(&self) -> &Sources[src]

Return the collection of source trees associated with this project, including both extern git repositories and local source trees.

pub fn sources_mut(&mut self) -> &mut Sources[src]

Return the collection of source trees associated with this project in mutable form.

pub fn hooks(&self) -> &HookManager[src]

Get our available hooks.

pub fn default_tags(&self) -> Option<&DefaultTags>[src]

Get the default tags associated with this project, if any.

pub fn set_default_tags(&mut self, tags: DefaultTags) -> &mut Project[src]

Set the default tags associated with this project.

pub fn plugins(&self) -> &Manager[src]

Our plugin manager.

pub fn save_settings(&mut self) -> Result<()>[src]

Save persistent project settings to disk.

pub fn enabled_pods_that_are_not_running(&self) -> Result<Vec<&Pod>>[src]

Find all enabled pods which do not appear to be running.

pub fn output(&self, subcommand: &str) -> Result<()>[src]

Delete our existing output and replace it with a processed and expanded version of our pod definitions.

pub fn export(&self, export_dir: &Path) -> Result<()>[src]

Export this project (with the specified target applied) as a set of standalone *.yml files with no environment variable interpolations and no external dependencies.

Trait Implementations

impl CommandCompose for Project[src]

impl CommandExec for Project[src]

impl CommandGenerate for Project[src]

impl CommandLogs for Project[src]

impl CommandPull for Project[src]

impl CommandRun for Project[src]

impl CommandRunScript for Project[src]

impl CommandSource for Project[src]

impl CommandStatus for Project[src]

impl CommandUp for Project[src]

impl Debug for Project[src]

impl Serialize for Project[src]

Auto Trait Implementations

impl !RefUnwindSafe for Project

impl !Send for Project

impl Sync for Project

impl Unpin for Project

impl !UnwindSafe for Project

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> GetTypeId for T where
    T: Any

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

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

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