Struct x_core::XCoreContext
source · pub struct XCoreContext { /* private fields */ }
Expand description
Core context shared across all of x.
Implementations§
source§impl XCoreContext
impl XCoreContext
sourcepub fn new(
project_root: &'static Utf8Path,
current_dir: Utf8PathBuf,
config: XCoreConfig
) -> Result<Self>
pub fn new( project_root: &'static Utf8Path, current_dir: Utf8PathBuf, config: XCoreConfig ) -> Result<Self>
Creates a new XCoreContext.
sourcepub fn project_root(&self) -> &'static Utf8Path
pub fn project_root(&self) -> &'static Utf8Path
Returns the project root for this workspace.
sourcepub fn config(&self) -> &XCoreConfig
pub fn config(&self) -> &XCoreConfig
Returns the core config.
sourcepub fn current_dir(&self) -> &Utf8Path
pub fn current_dir(&self) -> &Utf8Path
Returns the current working directory for this process.
sourcepub fn current_rel_dir(&self) -> &Utf8Path
pub fn current_rel_dir(&self) -> &Utf8Path
Returns the current working directory for this process, relative to the project root.
sourcepub fn current_dir_is_root(&self) -> bool
pub fn current_dir_is_root(&self) -> bool
Returns true if x has been run from the project root.
sourcepub fn package_graph(&self) -> Result<&PackageGraph>
pub fn package_graph(&self) -> Result<&PackageGraph>
Returns the package graph for this workspace.
sourcepub fn partition_workspace_names<'a, B>(
&self,
names: impl IntoIterator<Item = &'a str>
) -> Result<(B, B)>where
B: Default + Extend<&'a str>,
pub fn partition_workspace_names<'a, B>( &self, names: impl IntoIterator<Item = &'a str> ) -> Result<(B, B)>where B: Default + Extend<&'a str>,
For a given list of workspace packages, returns a tuple of (known, unknown) packages.
Initializes the package graph if it isn’t already done so, and returns an error if the
sourcepub fn subsets(&self) -> Result<&WorkspaceSubsets<'_>>
pub fn subsets(&self) -> Result<&WorkspaceSubsets<'_>>
Returns information about the subsets for this workspace.
sourcepub fn hakari_builder(&self) -> Result<HakariBuilder<'_>>
pub fn hakari_builder(&self) -> Result<HakariBuilder<'_>>
Returns a Hakari builder for this workspace.
sourcepub fn hakari_toml_options(&self) -> TomlOptions
pub fn hakari_toml_options(&self) -> TomlOptions
Returns the default Hakari TOML options for this workspace.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for XCoreContext
impl Send for XCoreContext
impl Sync for XCoreContext
impl Unpin for XCoreContext
impl UnwindSafe for XCoreContext
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> SafeBorrow<T> for Twhere
T: ?Sized,
impl<T> SafeBorrow<T> for Twhere T: ?Sized,
§fn borrow_replacement(ptr: &T) -> &T
fn borrow_replacement(ptr: &T) -> &T
Given
ptr
, which was obtained from a prior call to Self::borrow()
,
return a value with the same nominal lifetime which is guaranteed to
survive mutations to Self
. Read more