[][src]Trait smash_arc::ArcLookup

pub trait ArcLookup {
    fn get_file_info_buckets(&self) -> &[FileInfoBucket];
fn get_file_hash_to_path_index(&self) -> &[HashToIndex];
fn get_dir_hash_to_info_index(&self) -> &[HashToIndex];
fn get_dir_infos(&self) -> &[DirInfo];
fn get_file_paths(&self) -> &[FilePath];
fn get_file_info_indices(&self) -> &[FileInfoIndex];
fn get_file_infos(&self) -> &[FileInfo];
fn get_file_info_to_datas(&self) -> &[FileInfoToFileData];
fn get_file_datas(&self) -> &[FileData];
fn get_folder_offsets(&self) -> &[DirectoryOffset];
fn get_stream_entries(&self) -> &[StreamEntry];
fn get_stream_file_indices(&self) -> &[u32];
fn get_stream_datas(&self) -> &[StreamData];
fn get_quick_dirs(&self) -> &[QuickDir];
fn get_stream_hash_to_entries(&self) -> &[HashToIndex];
fn get_file_reader<'a>(&'a self) -> Box<dyn SeekRead + 'a>;
fn get_file_section_offset(&self) -> u64;
fn get_stream_section_offset(&self) -> u64;
fn get_shared_section_offset(&self) -> u64;
fn get_file_infos_mut(&mut self) -> &mut [FileInfo];
fn get_file_datas_mut(&mut self) -> &mut [FileData]; fn get_file_contents<Hash: Into<Hash40>>(
        &self,
        hash: Hash,
        region: Region
    ) -> Result<Vec<u8>, LookupError> { ... }
fn get_nonstream_file_contents<Hash: Into<Hash40>>(
        &self,
        hash: Hash,
        region: Region
    ) -> Result<Vec<u8>, LookupError> { ... }
fn get_stream_data(&self, hash: Hash40) -> Result<&StreamData, LookupError> { ... }
fn get_stream_file_contents<Hash: Into<Hash40>>(
        &self,
        hash: Hash
    ) -> Result<Vec<u8>, LookupError> { ... }
fn read_stream_file_data(
        &self,
        file_data: &StreamData
    ) -> Result<Vec<u8>, LookupError> { ... }
fn get_shared_files(
        &self,
        hash: Hash40,
        region: Region
    ) -> Result<Vec<Hash40>, LookupError> { ... }
fn get_bucket_for_hash(&self, hash: Hash40) -> &[HashToIndex] { ... }
fn get_file_path_index_from_hash(
        &self,
        hash: Hash40
    ) -> Result<u32, LookupError> { ... }
fn get_file_info_from_hash(
        &self,
        hash: Hash40
    ) -> Result<&FileInfo, LookupError> { ... }
fn get_dir_info_from_hash<Hash: Into<Hash40>>(
        &self,
        hash: Hash
    ) -> Result<&DirInfo, LookupError> { ... }
fn get_stream_listing(
        &self,
        dir: &str
    ) -> Result<&[StreamEntry], LookupError> { ... }
fn get_file_info_from_path_index(&self, path_index: u32) -> &FileInfo { ... }
fn get_file_info_from_path_index_mut(
        &mut self,
        path_index: u32
    ) -> &mut FileInfo { ... }
fn get_file_in_folder(
        &self,
        file_info: &FileInfo,
        region: Region
    ) -> FileInfoToFileData { ... }
fn get_file_data_from_hash(
        &self,
        hash: Hash40,
        region: Region
    ) -> Result<&FileData, LookupError> { ... }
fn get_file_data(&self, file_info: &FileInfo, region: Region) -> &FileData { ... }
fn get_file_data_mut(
        &mut self,
        file_info: &FileInfo,
        region: Region
    ) -> &mut FileData { ... }
fn get_folder_offset(&self, file_info: &FileInfo, region: Region) -> u64 { ... }
fn read_file_data(
        &self,
        file_data: &FileData,
        folder_offset: u64
    ) -> Result<Vec<u8>, LookupError> { ... }
fn get_file_offset_from_hash(
        &self,
        hash: Hash40,
        region: Region
    ) -> Result<u64, LookupError> { ... }
fn get_file_metadata<Hash: Into<Hash40>>(
        &self,
        hash: Hash,
        region: Region
    ) -> Result<FileMetadata, LookupError> { ... } }

The trait that allows different implementations of the arc to share the same code for making lookups into the filesystem use the same logic.

To implement, provide accessors for the needed data and all the lookups themselves will be implemented for you.

Required methods

Loading content...

Provided methods

fn get_file_contents<Hash: Into<Hash40>>(
    &self,
    hash: Hash,
    region: Region
) -> Result<Vec<u8>, LookupError>
[src]

fn get_nonstream_file_contents<Hash: Into<Hash40>>(
    &self,
    hash: Hash,
    region: Region
) -> Result<Vec<u8>, LookupError>
[src]

fn get_stream_data(&self, hash: Hash40) -> Result<&StreamData, LookupError>[src]

fn get_stream_file_contents<Hash: Into<Hash40>>(
    &self,
    hash: Hash
) -> Result<Vec<u8>, LookupError>
[src]

fn read_stream_file_data(
    &self,
    file_data: &StreamData
) -> Result<Vec<u8>, LookupError>
[src]

fn get_shared_files(
    &self,
    hash: Hash40,
    region: Region
) -> Result<Vec<Hash40>, LookupError>
[src]

fn get_bucket_for_hash(&self, hash: Hash40) -> &[HashToIndex][src]

fn get_file_path_index_from_hash(
    &self,
    hash: Hash40
) -> Result<u32, LookupError>
[src]

fn get_file_info_from_hash(
    &self,
    hash: Hash40
) -> Result<&FileInfo, LookupError>
[src]

fn get_dir_info_from_hash<Hash: Into<Hash40>>(
    &self,
    hash: Hash
) -> Result<&DirInfo, LookupError>
[src]

fn get_stream_listing(&self, dir: &str) -> Result<&[StreamEntry], LookupError>[src]

fn get_file_info_from_path_index(&self, path_index: u32) -> &FileInfo[src]

fn get_file_info_from_path_index_mut(
    &mut self,
    path_index: u32
) -> &mut FileInfo
[src]

fn get_file_in_folder(
    &self,
    file_info: &FileInfo,
    region: Region
) -> FileInfoToFileData
[src]

fn get_file_data_from_hash(
    &self,
    hash: Hash40,
    region: Region
) -> Result<&FileData, LookupError>
[src]

fn get_file_data(&self, file_info: &FileInfo, region: Region) -> &FileData[src]

fn get_file_data_mut(
    &mut self,
    file_info: &FileInfo,
    region: Region
) -> &mut FileData
[src]

fn get_folder_offset(&self, file_info: &FileInfo, region: Region) -> u64[src]

fn read_file_data(
    &self,
    file_data: &FileData,
    folder_offset: u64
) -> Result<Vec<u8>, LookupError>
[src]

fn get_file_offset_from_hash(
    &self,
    hash: Hash40,
    region: Region
) -> Result<u64, LookupError>
[src]

fn get_file_metadata<Hash: Into<Hash40>>(
    &self,
    hash: Hash,
    region: Region
) -> Result<FileMetadata, LookupError>
[src]

Loading content...

Implementors

impl ArcLookup for ArcFile[src]

impl ArcLookup for LoadedArc[src]

Loading content...