pub struct WorkspaceConfig { /* private fields */ }Expand description
Scope is a structure containing all of the information required for the service to operate.
Implementations§
Source§impl WorkspaceConfig
impl WorkspaceConfig
pub fn new<T>(workdir: T) -> Self
Sourcepub fn artifacts(&self) -> &str
pub fn artifacts(&self) -> &str
returns a reference to the path of the artifacts directory, as a str
Sourcepub fn application(&self) -> &str
pub fn application(&self) -> &str
returns the name of the application
Sourcepub fn with_artifacts<T>(self, artifacts: T) -> Selfwhere
T: ToString,
pub fn with_artifacts<T>(self, artifacts: T) -> Selfwhere
T: ToString,
consumes the workspace config to create another with the given artifacts directory
Sourcepub fn with_application<T>(self, application: T) -> Selfwhere
T: ToString,
pub fn with_application<T>(self, application: T) -> Selfwhere
T: ToString,
consumes the workspace config to create another with the given application name
Sourcepub fn with_build<T>(self, build: T) -> Selfwhere
T: ToString,
pub fn with_build<T>(self, build: T) -> Selfwhere
T: ToString,
consumes the workspace config to create another with the given build path
Sourcepub fn with_workdir(self, workdir: PathBuf) -> Self
pub fn with_workdir(self, workdir: PathBuf) -> Self
consumes the workspace config to create another with the given workdir
Sourcepub fn set_artifacts<T>(&mut self, artifacts: T)where
T: ToString,
pub fn set_artifacts<T>(&mut self, artifacts: T)where
T: ToString,
update the artifacts directory
Sourcepub fn set_application<T>(&mut self, application: T)where
T: ToString,
pub fn set_application<T>(&mut self, application: T)where
T: ToString,
update the application name
Sourcepub fn set_current_dir(&self)
pub fn set_current_dir(&self)
change the current directory to the workspace
Sourcepub fn set_workdir<T>(&mut self, workdir: T)
pub fn set_workdir<T>(&mut self, workdir: T)
set the working directory of the scope
Sourcepub fn set_workdir_option<T>(&mut self, workdir: Option<T>)
pub fn set_workdir_option<T>(&mut self, workdir: Option<T>)
if the workdir is set, set it to the given workdir
Sourcepub fn is_workdir_valid(&self) -> bool
pub fn is_workdir_valid(&self) -> bool
check if the workdir is valid
Sourcepub fn path_to_application(&self) -> PathBuf
pub fn path_to_application(&self) -> PathBuf
get the path to the application binary; if unspecified, the current executable is used otherwise, the path is assumed to be within the workspaces current directory.
Sourcepub fn path_to_artifacts(&self) -> PathBuf
pub fn path_to_artifacts(&self) -> PathBuf
get the path to the artifacts directory; the artifacts directory assumed to be a subdirectory of the workspace and is used to store various build artifacts, logs, temporary files, etc.
Trait Implementations§
Source§impl Clone for WorkspaceConfig
impl Clone for WorkspaceConfig
Source§fn clone(&self) -> WorkspaceConfig
fn clone(&self) -> WorkspaceConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WorkspaceConfig
impl Debug for WorkspaceConfig
Source§impl Default for WorkspaceConfig
impl Default for WorkspaceConfig
Source§impl<'de> Deserialize<'de> for WorkspaceConfigwhere
WorkspaceConfig: Default,
impl<'de> Deserialize<'de> for WorkspaceConfigwhere
WorkspaceConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for WorkspaceConfig
impl Display for WorkspaceConfig
impl Eq for WorkspaceConfig
Source§impl Hash for WorkspaceConfig
impl Hash for WorkspaceConfig
Source§impl Ord for WorkspaceConfig
impl Ord for WorkspaceConfig
Source§fn cmp(&self, other: &WorkspaceConfig) -> Ordering
fn cmp(&self, other: &WorkspaceConfig) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for WorkspaceConfig
impl PartialEq for WorkspaceConfig
Source§fn eq(&self, other: &WorkspaceConfig) -> bool
fn eq(&self, other: &WorkspaceConfig) -> bool
self and other values to be equal, and is used by ==.