pub struct Settings { /* private fields */ }
Expand description
Declares the configuration required to instantiate and configure the hierarchy of SharedProject
which are part of this build. There’s exactly one settings instance that’s created per
settings file.
§Assembling a mutli-project build
One of the purposes of the Settings
object is to allow you to declare projects which are
included in this build.
When included, a ProjectDescriptor
is created which can be used to configure the default
values for several properties of the project.
§Using Settings in a Settings File
Depends on the builder..
Implementations§
Source§impl Settings
impl Settings
Sourcepub fn new(
assemble: &Arc<RwLock<RawRwLock, Assemble>>,
root_dir: PathBuf,
settings_file: PathBuf,
) -> Settings
pub fn new( assemble: &Arc<RwLock<RawRwLock, Assemble>>, root_dir: PathBuf, settings_file: PathBuf, ) -> Settings
Create a new Settings
instance.
Sourcepub fn root_project(&self) -> &ProjectDescriptor
pub fn root_project(&self) -> &ProjectDescriptor
Gets the root project descriptor
Sourcepub fn root_project_mut(&mut self) -> &mut ProjectDescriptor
pub fn root_project_mut(&mut self) -> &mut ProjectDescriptor
Gets a mutable reference to the root project descriptor
Sourcepub fn add_project<S, F>(&mut self, path: S, configure: F)
pub fn add_project<S, F>(&mut self, path: S, configure: F)
Adds a child project to the root project
Sourcepub fn include_all<S, I>(&mut self, paths: I)
pub fn include_all<S, I>(&mut self, paths: I)
Includes a project a path.
Sourcepub fn find_project(&self, path: impl AsRef<Path>) -> Option<&ProjectDescriptor>
pub fn find_project(&self, path: impl AsRef<Path>) -> Option<&ProjectDescriptor>
Find a project within this build
Sourcepub fn find_project_mut(
&mut self,
path: impl AsRef<Path>,
) -> Option<&mut ProjectDescriptor>
pub fn find_project_mut( &mut self, path: impl AsRef<Path>, ) -> Option<&mut ProjectDescriptor>
Find a project within this build
Sourcepub fn children_projects(
&self,
proj: &ProjectDescriptor,
) -> impl IntoIterator<Item = &ProjectDescriptor>
pub fn children_projects( &self, proj: &ProjectDescriptor, ) -> impl IntoIterator<Item = &ProjectDescriptor>
Gets the child project of a given project
pub fn set_build_file_name(&mut self, path: impl AsRef<str>)
pub fn settings_file(&self) -> &Path
Sourcepub fn project_graph(&self) -> &ProjectGraph
pub fn project_graph(&self) -> &ProjectGraph
Gets the project graph
Trait Implementations§
Source§impl PluginAware for Settings
impl PluginAware for Settings
Source§fn plugin_manager(&self) -> &PluginManager<Settings>
fn plugin_manager(&self) -> &PluginManager<Settings>
Source§fn plugin_manager_mut(&mut self) -> &mut PluginManager<Settings>
fn plugin_manager_mut(&mut self) -> &mut PluginManager<Settings>
Source§fn apply_plugin<P>(&mut self) -> Result<(), PayloadError<ProjectError>>where
P: Plugin<Self>,
fn apply_plugin<P>(&mut self) -> Result<(), PayloadError<ProjectError>>where
P: Plugin<Self>,
Source§impl SettingsAware for Settings
impl SettingsAware for Settings
fn with_settings<F, R>(&self, func: F) -> R
fn with_settings_mut<F, R>(&mut self, func: F) -> R
Auto Trait Implementations§
impl Freeze for Settings
impl !RefUnwindSafe for Settings
impl Send for Settings
impl Sync for Settings
impl Unpin for Settings
impl !UnwindSafe for Settings
Blanket Implementations§
Source§impl<S> AssembleAware for Swhere
S: SettingsAware,
impl<S> AssembleAware for Swhere
S: SettingsAware,
Source§fn with_assemble<F, R>(&self, func: F) -> R
fn with_assemble<F, R>(&self, func: F) -> R
Source§fn with_assemble_mut<F, R>(&mut self, func: F) -> R
fn with_assemble_mut<F, R>(&mut self, func: F) -> R
fn start_parameter(&self) -> StartParameter
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> InstanceOf for T
impl<T> InstanceOf for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more