Struct aabb_cw_orch::prelude::ArtifactsDir
source · pub struct ArtifactsDir(_);
Expand description
Points to a directory containing WASM files
Example
use cw_orch::prelude::{ArtifactsDir, WasmPath};
// Get the artifacts directory from the environment variable `ARTIFACTS_DIR`.
let artifact_dir = ArtifactsDir::env();
// Or create a new one.
let artifact_dir = ArtifactsDir::new("path/to/artifacts");
// Get a path to a WASM file that contains the string "my_contract".
let wasm_path: WasmPath = artifact_dir.find_wasm_path("my_contract").unwrap();
Implementations§
source§impl ArtifactsDir
impl ArtifactsDir
sourcepub fn auto(start_path: Option<String>) -> Self
pub fn auto(start_path: Option<String>) -> Self
Creates an artifacts dir by searching for an artifacts directory by going up the file tree from start_path or the current directory
sourcepub fn new(path: impl Into<PathBuf>) -> Self
pub fn new(path: impl Into<PathBuf>) -> Self
Create a new ArtifactsDir from a path to a directory containing WASM files.
sourcepub fn find_wasm_path(&self, name: &str) -> Result<WasmPath, CwOrchError>
pub fn find_wasm_path(&self, name: &str) -> Result<WasmPath, CwOrchError>
Find a WASM file in the artifacts directory that contains the given name.
Auto Trait Implementations§
impl RefUnwindSafe for ArtifactsDir
impl Send for ArtifactsDir
impl Sync for ArtifactsDir
impl Unpin for ArtifactsDir
impl UnwindSafe for ArtifactsDir
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request