pub struct Environment {
pub root: PathBuf,
pub target_dir: PathBuf,
pub manifest: ProjectManifest,
pub cache_manager: Arc<CacheManager>,
}Expand description
Central context to manage cargo compilation environment
Fields§
§root: PathBuf§target_dir: PathBuf§manifest: ProjectManifest§cache_manager: Arc<CacheManager>Implementations§
Source§impl Environment
impl Environment
Sourcepub async fn new(
root: PathBuf,
cache_manager: Arc<CacheManager>,
) -> EnvResult<Self>
pub async fn new( root: PathBuf, cache_manager: Arc<CacheManager>, ) -> EnvResult<Self>
Create a new Environment by fetching metadata and detecting manifests from the given root
pub fn package(&self) -> String
pub fn version(&self) -> String
Sourcepub async fn get_target_dir(path: &Path) -> EnvResult<PathBuf>
pub async fn get_target_dir(path: &Path) -> EnvResult<PathBuf>
Run cargo metadata to find the target directory
pub async fn generate_lockfile(&self) -> EnvResult<String>
Sourcepub async fn compile(&self, extra_args: &[&str], capture: bool) -> EnvResult<()>
pub async fn compile(&self, extra_args: &[&str], capture: bool) -> EnvResult<()>
Compile the project (defaults to release)
Sourcepub fn get_wasm_artifact(&self, name: &str) -> EnvResult<PathBuf>
pub fn get_wasm_artifact(&self, name: &str) -> EnvResult<PathBuf>
Get path to the compiled wasm artifact
Sourcepub async fn get_library_artifact(&self, name: &str) -> EnvResult<CapBinary>
pub async fn get_library_artifact(&self, name: &str) -> EnvResult<CapBinary>
Get path to the compiled library artifact (dylib/so/dll)
Sourcepub async fn load_artifacts_from_target(
&self,
target_dir: &Path,
) -> EnvResult<Vec<Artifacts>>
pub async fn load_artifacts_from_target( &self, target_dir: &Path, ) -> EnvResult<Vec<Artifacts>>
Load artifacts from an existing target directory without compiling
pub async fn pack(&self, capture: bool) -> EnvResult<Vec<Artifacts>>
pub async fn expand_debug(&self) -> EnvResult<()>
pub async fn capability_spec(&self) -> EnvResult<InterfaceSpec<'static>>
pub async fn playbook_spec(&self) -> EnvResult<PlaybookSpec>
Auto Trait Implementations§
impl Freeze for Environment
impl RefUnwindSafe for Environment
impl Send for Environment
impl Sync for Environment
impl Unpin for Environment
impl UnsafeUnpin for Environment
impl UnwindSafe for Environment
Blanket Implementations§
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
Mutably borrows from an owned value. Read more