Trait smash_arc::ArcLookup

source ·
pub trait ArcLookup {
Show 50 methods // Required methods 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_dir_infos_mut(&mut self) -> &mut [DirInfo]; fn get_file_datas_mut(&mut self) -> &mut [FileData]; fn get_file_info_to_datas_mut(&mut self) -> &mut [FileInfoToFileData]; fn get_folder_offsets_mut(&mut self) -> &mut [DirectoryOffset]; // Provided methods fn get_file_contents<Hash: Into<Hash40>>( &self, hash: Hash, region: Region ) -> Result<Vec<u8>, LookupError> { ... } fn get_dir_info_from_hash<Hash: Into<Hash40>>( &self, hash: Hash ) -> Result<&DirInfo, LookupError> { ... } fn get_dir_info_from_hash_mut<Hash: Into<Hash40>>( &mut self, hash: Hash ) -> Result<&mut DirInfo, LookupError> { ... } fn get_nonstream_file_contents<Hash: Into<Hash40>>( &self, hash: Hash, region: Region ) -> Result<Vec<u8>, LookupError> { ... } fn get_stream_entry( &self, hash: Hash40 ) -> Result<&StreamEntry, LookupError> { ... } fn get_stream_data( &self, hash: Hash40, region: Region ) -> Result<&StreamData, LookupError> { ... } fn get_stream_file_contents<Hash: Into<Hash40>>( &self, hash: Hash, region: Region ) -> 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<FilePathIdx, LookupError> { ... } fn get_file_info_from_hash( &self, hash: Hash40 ) -> Result<&FileInfo, LookupError> { ... } fn get_stream_listing( &self, dir: &str ) -> Result<&[StreamEntry], LookupError> { ... } fn get_file_info_from_path_index( &self, path_index: FilePathIdx ) -> &FileInfo { ... } fn get_file_info_from_path_index_mut( &mut self, path_index: FilePathIdx ) -> &mut FileInfo { ... } fn get_file_in_folder( &self, file_info: &FileInfo, region: Region ) -> FileInfoToFileData { ... } fn get_file_in_folder_mut( &mut self, file_info: &FileInfo, region: Region ) -> &mut 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 get_directory_dependency( &self, dir_info: &DirInfo ) -> Option<RedirectionType> { ... } 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_shared_data_index(&self) -> u32 { ... } fn get_file_metadata<Hash: Into<Hash40>>( &self, hash: Hash, region: Region ) -> Result<FileMetadata, LookupError> { ... }
}
Expand description

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§

Provided Methods§

source

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

source

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

source

fn get_dir_info_from_hash_mut<Hash: Into<Hash40>>( &mut self, hash: Hash ) -> Result<&mut DirInfo, LookupError>

source

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

source

fn get_stream_entry(&self, hash: Hash40) -> Result<&StreamEntry, LookupError>

source

fn get_stream_data( &self, hash: Hash40, region: Region ) -> Result<&StreamData, LookupError>

source

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

source

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

source

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

source

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

source

fn get_file_path_index_from_hash( &self, hash: Hash40 ) -> Result<FilePathIdx, LookupError>

source

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

source

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

source

fn get_file_info_from_path_index(&self, path_index: FilePathIdx) -> &FileInfo

source

fn get_file_info_from_path_index_mut( &mut self, path_index: FilePathIdx ) -> &mut FileInfo

source

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

source

fn get_file_in_folder_mut( &mut self, file_info: &FileInfo, region: Region ) -> &mut FileInfoToFileData

source

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

source

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

source

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

source

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

source

fn get_directory_dependency( &self, dir_info: &DirInfo ) -> Option<RedirectionType>

source

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

source

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

source

fn get_shared_data_index(&self) -> u32

source

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

Object Safety§

This trait is not object safe.

Implementors§