Skip to main content

open_image

Function open_image 

Source
pub fn open_image<'a>(
    image: impl Image + 'a,
) -> Result<Arc<Pfs<'a>>, OpenImageError>
Expand description

Opens a PFS image for reading from any Image implementation.

This is used when the PFS image is behind a transformation layer (e.g. a file within another PFS, optionally PFSC-compressed). The image is read entirely through Image::read_at().

§Arguments

  • image - An Image providing positional read access to the PFS data

§Returns

Returns a thread-safe, reference-counted Pfs handle on success.

§Errors

Returns an OpenImageError if the image header or block structure is invalid.

§Example

use orbis_pfs::image::Image;

let pfs = orbis_pfs::open_image(image)?;
println!("Opened PFS with {} inodes", pfs.inode_count());