MCPcopy Create free account
hub / github.com/dfinity/orbit / as_path_bufs

Method as_path_bufs

tools/dfx-orbit/src/util.rs:7–22  ·  view source on GitHub ↗
(
        &self,
        canister: &str,
        paths: &[String],
    )

Source from the content-addressed store, hash-verified

5
6impl DfxOrbit {
7 pub(super) fn as_path_bufs(
8 &self,
9 canister: &str,
10 paths: &[String],
11 ) -> anyhow::Result<Vec<PathBuf>> {
12 if paths.is_empty() {
13 let canister_config = self.get_canister_config(canister)?;
14 let CanisterTypeProperties::Assets { source, .. } = &canister_config.type_specific
15 else {
16 bail!("Canister {canister} is not an asset canister");
17 };
18 Ok(source.clone())
19 } else {
20 Ok(paths.iter().map(|source| PathBuf::from(&source)).collect())
21 }
22 }
23
24 pub(super) fn as_paths(paths: &[PathBuf]) -> Vec<&Path> {
25 paths.iter().map(|pathbuf| pathbuf.as_path()).collect()

Callers 3

into_requestMethod · 0.80
verifyMethod · 0.80
into_requestMethod · 0.80

Calls 4

get_canister_configMethod · 0.80
mapMethod · 0.80
iterMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected