pub struct Project { /* private fields */ }
Expand description

The Project contains the tasks, layout information, and other related objects that would help with project building.

The project itself should be able to provide all information required to build a project, but should not be the driver of the building itself. Instead, project visitors should be driven to create project files.

By default, projects are created in the current directory.

Example

let mut task_provider = project.tasks().register_task::<Empty>("hello_world").expect("Couldn't create 'hello_task'");
task_provider.configure_with(|empty, _project| {
    empty.do_first(|_, _| {
        println!("Hello, World");
        Ok(())
    }).unwrap();
    Ok(())
}).unwrap();

Implementations§

Create a new Project, with the current directory as the the directory to load

Creates an assemble project in a specified directory.

Creates an assemble project in the current directory using an identifier

Creates an assemble project in a specified directory.

Creates an assemble project in a specified directory.

Get the id of the project

Gets the directory where created files should be stored

Always set as relative to the project dir

Gets a list of all tasks by TaskId

Create files using some valid types

Allowed types:

  • &str
  • String
  • Path
  • Regular File

Run a visitor on the project

Run a mutable visitor on the project

The directory of the project

The project directory for the root directory

Get access to the task container

Get access to the task container

Get an outgoing variant

Gets the shared reference version of this project

Gets the factory for generating task ids

Gets the subprojects for this project.

Gets the default tasks for this project.

Default tasks are executed if no other tasks are provided.

Set the default tasks for this project.

apply a configuration function on the registries container

apply a function on the registries container

Get the dependencies for this project

Get a mutable reference to the dependencies container for this project

Create a sub project with a given name. The path used is the $PROJECT_DIR/name

Create a sub project with a given name at a path.

Gets the root project of this project.

Gets the parent project of this project, if it exists

The variants of this project

The mutable variants of this project

Trait Implementations§

Creates an inter-project dependency with the default configuration
Creates an inter-project dependency with a given configuration
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more
Gets the extension container
Gets a mutable reference to the extension container
If a single extension is registered with a given type, a reference to that value is returned as Some(_)
If a single extension is registered with a given type, a mutable reference to that value is returned as Some(_)
Get whether this project is a root
Apply the plugin
The id of the plugin. A plugin of a certain ID can only added once
Apply the plugin
The id of the plugin. A plugin of a certain ID can only added once
Gets a reference to the plugin manager for this value.
Gets a mutable reference to the plugin manager for this value.
Apply a plugin to this.
Try to get a resource from a project.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Get the assemble instance this value is aware of.
Get the assemble instance this value is aware of as a mutable reference
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Add a name to this object
The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more