Skip to main content

Container

Struct Container 

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

One read-only ZIP container. Methods serialize access through &mut self. Open does not certify contents. Backing files must remain unchanged.

Implementations§

Source§

impl Container

Source

pub fn disk_images(&self) -> Result<Vec<DiskImageInfo>>

Enumerates explicitly typed physical images in a single AFF4 1.0 volume. Storage streams, logical files, and memory images are not disk candidates. Invalid image sizes or contradictory block sizes are errors, not omissions.

Source

pub fn into_disk_reader(self, resource: Option<&str>) -> Result<DiskImageReader>

Selects a physical image by identifier and transfers this container to a cursor. With None, exactly one disk candidate is required. Selection never chooses an underlying ImageStream or Map. Opening does not verify the whole image.

Source§

impl Container

Source

pub fn verify_metadata( &mut self, expected_sha256: Option<&str>, ) -> Result<MetadataVerification>

Verifies exact metadata bytes using draft RDF and legacy Gemino JSON hashes. Both representations are checked when present; conflicts cannot be hidden by preferring one. Imported metadata is checked against its RDF references. expected_sha256 is an independently recorded information.turtle digest. This does not hash the ZIP archive or verify evidence streams/signatures.

Source§

impl Container

Source

pub fn verify_all( &mut self, expected_metadata_sha256: Option<&str>, progress: impl FnMut(&str, u64, u64) -> ControlFlow<()>, ) -> Result<ContainerVerification>

Checks metadata and all data resources, continuing after individual failures. Progress cancellation aborts the entire operation. Unknown digest semantics are reported as unsupported, never inferred from the digest length.

Source§

impl Container

Source

pub fn scan_metadata( path: impl AsRef<Path>, limits: Limits, visit: impl FnMut(&str, &str, &Property) -> ControlFlow<()>, ) -> Result<MetadataScan>

Streams primary and imported RDF statements without constructing a graph. Subject order is arbitrary; callers must not assume adjacent statements describe a complete object. The callback receives source-member provenance. This is an inventory operation, not content or metadata verification. ZIP directory and entry limits are checked before ZIP parsing.

Source§

impl Container

Source

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

Opens a standard v1 ZIP container with default resource limits.

Source

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

Opens a container, validates its version, and parses bounded RDF metadata. External RDF references are never fetched over the network.

Source

pub fn metadata(&self) -> &BTreeMap<String, Vec<Property>>

Preserves all parsed RDF properties, including unsupported extensions.

Source

pub fn volume_id(&self) -> &str

Returns the declared volume identifier.

Source

pub fn version(&self) -> (u32, u32)

Declared container version; 2.1 refers to the evolving AFF4-L draft.

Source

pub fn reader_statistics(&self) -> ReaderStatistics

Returns cumulative decoded-chunk reader counters.

Source

pub fn reader_cache_info(&self) -> ReaderCacheInfo

Returns automatic decoded-chunk cache usage.

Source

pub fn streams(&self) -> Result<Vec<StreamInfo>>

Enumerates image resources and storage streams. Selection is never implicit.

Source

pub fn size(&self, id: &str) -> Result<u64>

Returns the size of a selected resource, resolving its dataStream reference.

Source

pub fn read_at( &mut self, id: &str, buffer: &mut [u8], offset: u64, ) -> Result<usize>

Reads a selected stream at a byte offset. Missing targets, cycles, corrupt chunks, and unknown/unreadable symbolic data return errors.

Source

pub fn sequential_reader(&mut self, id: &str) -> Result<Box<dyn Read + '_>>

Reads a resource sequentially. ZIP segments, including those behind identity maps, retain one decompressor across reads; other resources use positioned reads through their maps. The caller must read the declared size to detect a truncated stream.

Source

pub fn verify( &mut self, id: &str, progress: impl FnMut(u64, u64) -> ControlFlow<()>, ) -> Result<Verification>

Computes linear hashes with progress and cancellation. Does not verify block hashes, map hashes, signatures, or metadata integrity.

Source

pub fn copy_verified( &mut self, id: &str, output: &mut impl Write, progress: impl FnMut(u64, u64) -> ControlFlow<()>, ) -> Result<Verification>

Copies exact logical bytes while computing and comparing linear hashes. The caller owns staging/publication and must inspect references_match. Partial output may remain in the sink after any failure or cancellation.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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, 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