Skip to main content

BundlePullArgs

Struct BundlePullArgs 

Source
pub struct BundlePullArgs {
Show 13 fields pub input: Option<PathBuf>, pub hash: Option<String>, pub output: PathBuf, pub jobs: usize, pub max_lane_streams: u16, pub include: Vec<String>, pub exclude: Vec<String>, pub select: bool, pub overwrite: bool, pub dry_run: bool, pub json: bool, pub namespace: Option<u64>, pub common: ClientFetchArgs,
}
Expand description

decdn bundle pull — fetch a bundle’s blobs into a directory.

The bundle source is exactly one of -i <file> (a local manifest) or --hash <b3> (fetch the manifest blob first, then its entries). Both then run the same per-entry fetch loop. The network/chain/target flags come from the flattened ClientFetchArgs — --node-id pins every entry to one node, otherwise each entry is discovered independently (#936/#391); --capability / --capability-file adopts one publisher-delegated pool and pays every entry from it. --namespace (ADR 002) routes every cache-miss origin pull to a namespace’s authorized origins.

Fields§

§input: Option<PathBuf>

Local bundle manifest file to pull. Mutually exclusive with --hash.

§hash: Option<String>

BLAKE3 hash (64 hex, optional 0x/b3: prefix) of the bundle manifest blob to fetch first, then pull. Mutually exclusive with -i.

§output: PathBuf

Output directory the bundle’s files are written under (created if absent). Each entry’s relative path is resolved within this root; ../absolute/escaping paths are rejected.

§jobs: usize

Maximum concurrent entry fetches across the whole run. Each distinct blob is one unit of work holding one slot: a plain whole-file entry, or a range-dedup entry across its complement drive, donor splice, and any re-fetch. A range-dedup entry that only waits for a sibling to finish the chunks it splices gives its slot to a queued entry until then. A byte range a sibling entry already holds is spliced from disk, not fetched, so it never takes a slot of its own.

§max_lane_streams: u16

Maximum concurrent streams to one (pool, signer, provider) lane. Same-lane streams share one cumulative voucher watermark, and the serving node credits each stream’s delivered bytes from that shared lane fairly (a slow stream is paid from the headroom a faster sibling opened), so same-lane concurrency is safe and this only bounds how many streams touch one provider at once. Cross-lane parallelism (distinct providers) is bounded by --jobs regardless.

One connection per node carries every stream of the command, so the bound (1 to 64) stays below the node’s limit of concurrent streams on one connection.

§include: Vec<String>

Only pull entries whose POSIX relative path matches one of these globs (models/*.bin), matched against the manifest’s path field, never the on-disk absolute path. Repeatable — an entry passes the include gate if it matches any one. Absent => every entry passes the gate. gitignore semantics: * does not cross /, ** recurses.

§exclude: Vec<String>

Skip entries whose POSIX relative path matches one of these globs, matched against the manifest’s path field. Repeatable — every pattern is OR-ed. --exclude wins over --include: an entry matching both is skipped. Same gitignore glob semantics as --include.

§select: bool

Choose which files to pull interactively: open the (post---include/ --exclude) file list in $VISUAL/$EDITOR, one path per line. Comment out (prefix #) or delete any line to skip that file; save and exit to pull the rest. Useful when you don’t know a bundle’s contents up front — the list is what the manifest actually holds. Requires an interactive terminal; incompatible with --json and --dry-run.

§overwrite: bool

Re-fetch and overwrite entries whose destination file already exists. Default is skip-existing (resume-friendly): a path skips when its saved .decdn-manifest.json record still matches the file’s hash, size, and mtime — the fast path, which trusts that gate without re-hashing — or, failing that, when re-hashing its on-disk bytes matches the new manifest. A file byte-identical to one already anywhere else in the output root is likewise reused with no download: it is linked (or copied) from that on-disk file once its hash is confirmed by a re-hash. Use --overwrite to force a full re-fetch of every entry, for example when the output directory may have been modified outside decdn (an in-place edit that keeps a file’s size and mtime is otherwise trusted by the fast path). It skips consulting .decdn-manifest.json for skip decisions, so it disables both the skip-existing path and the whole-root reuse above; the file is still read and rewritten with the run’s results.

§dry_run: bool

Print the entries the run would pull (paths + sizes, after --include/--exclude; files already present are still listed) and exit without any network or chain activity. With --hash, entries are listed only when an earlier pull into the same output directory cached the bundle manifest.

§json: bool

Emit a one-line JSON summary instead of human-readable output.

§namespace: Option<u64>

Namespace the whole bundle is published under (ADR 002 § Retrieval by namespace). Applies to EVERY fetch in the run — the manifest blob and each entry — so a serving node routes any cache-miss origin pull to that namespace’s DAO-authorized origins. The manifest format carries no per-entry namespace, so this is necessarily bundle-level. Absent => no namespace: served best-effort from cache / DHT only.

§common: ClientFetchArgs

Retrieval flags shared with decdn fetch: peer discovery, payment pool, and output handling.

Trait Implementations§

Source§

impl Args for BundlePullArgs

Source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

impl Debug for BundlePullArgs

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for BundlePullArgs

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more