Skip to main content

Collection

Struct Collection 

Source
pub struct Collection { /* private fields */ }
Expand description

Shared immutable collection bytes. Cloning shares payload allocations.

use powerio::{Collection, CollectionLimits, CollectionSelection, ParseOptions};
let collection = Collection::from_directory("study", CollectionLimits::default())?;
for candidate in collection.inspect()? {
    println!("{:?}", candidate);
}
let selection = CollectionSelection::file("masters/weekday.dss").format("dss");
let result = collection.parse(&selection, &ParseOptions::default())?;
println!("observed dependencies: {:?}", result.dependencies);

Implementations§

Source§

impl Collection

Source

pub fn origin(&self) -> CollectionOrigin

Source

pub fn selection_origin( &self, selection: &CollectionSelection, ) -> SelectionOrigin

Source

pub fn read_manifest(&self, bytes: &[u8]) -> Result<CollectionManifest>

Read bounded metadata only. Nested paths are validated syntactically; opening them and validating selected members waits for explicit use.

Source

pub fn parse_manifest_case( &self, manifest: &CollectionManifest, id: &str, ) -> Result<CollectionResult>

Execute one catalog case explicitly; siblings remain independent.

Source

pub fn source_bundle( &self, selection: &CollectionSelection, scope: SourceBundleScope, ) -> Result<SourceBundle>

Export an explicitly requested source scope. Bytes are shared, and the collection need not stay alive after the bundle has been returned.

Source§

impl Collection

Source

pub fn open_nested(&self, member: &str) -> Result<Self>

Open exactly one named child ZIP. Its namespace is independent: sources cannot resolve against a parent or sibling. All descendants and clones share the monotonic entry and expansion counters of admitted content, so reopening a child counts again, while each open’s own input and decompression work is bounded on its own.

Source

pub fn cancellation(&self) -> Cancellation

Cancel subsequent discovery, child acquisition, and selected parses. ZIP reads check the signal between chunks. Electrical parsers retain their own bounded work rules; synchronous WASM may be terminated by its worker.

Source§

impl Collection

Source

pub fn from_files( name: impl Into<String>, files: impl IntoIterator<Item = (ArtifactPath, Arc<[u8]>)>, limits: CollectionLimits, ) -> Result<Self>

Admit a named memory tree. Does not execute a parser or read the host.

Source

pub fn from_zip( name: impl Into<String>, bytes: Arc<[u8]>, limits: CollectionLimits, ) -> Result<Self>

Fully verify a bounded ZIP once. Original container and member bytes are retained separately. Nested containers remain ordinary opaque members.

Source

pub fn from_zip_cancellable( name: impl Into<String>, bytes: Arc<[u8]>, limits: CollectionLimits, cancel: Cancellation, ) -> Result<Self>

Acquire a ZIP with a caller-owned cancellation signal.

Source

pub fn from_directory( path: impl AsRef<Path>, limits: CollectionLimits, ) -> Result<Self>

Acquire a folder through core’s confined source reader. Once acquired, selections cannot fall back to disk or see later filesystem changes.

Source

pub fn name(&self) -> &str

Source

pub fn entries(&self) -> &[CollectionEntry]

Source

pub fn original_zip(&self) -> Option<Arc<[u8]>>

Source

pub fn inspect(&self) -> Result<Vec<CollectionCandidate>>

Bounded suggestions, without electrical parsing or filename precedence. Every inventory file remains explicitly selectable even if omitted here.

Source

pub fn source(&self, selection: &CollectionSelection) -> Result<Source>

Build one confined source. Each call starts fresh observations; retained companions share bytes. Generic ZIP traversal requires another operation.

Source

pub fn parse( &self, selection: &CollectionSelection, options: &ParseOptions, ) -> Result<CollectionResult>

Parse or deserialize one explicit selection. Call independently for each selected case; one error never prevents processing another selection.

Source§

impl Collection

Source

pub fn open(path: impl AsRef<Path>, limits: CollectionLimits) -> Result<Self>

Open a folder or transport ZIP. The compressed input read is bounded before retention; member acquisition then enforces expansion limits.

Trait Implementations§

Source§

impl Clone for Collection

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Collection

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

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

§

fn vzip(self) -> V