pub struct ArcFile {
pub stream_section_offset: u64,
pub file_section_offset: u64,
pub shared_section_offset: u64,
pub file_system: FileSystem,
pub search_file_system: SearchFileSystem,
pub reader: Mutex<Box<dyn SeekRead + Send>>,
pub dirs: HashMap<Hash40, Vec<FileNode>>,
}
Expand description
A struct representing the data.arc file
Fields§
§stream_section_offset: u64
§file_section_offset: u64
§file_system: FileSystem
§search_file_system: SearchFileSystem
§reader: Mutex<Box<dyn SeekRead + Send>>
§dirs: HashMap<Hash40, Vec<FileNode>>
Implementations§
Source§impl ArcFile
impl ArcFile
pub fn open<P: AsRef<Path>>(path: P) -> BinResult<Self>
pub fn open_over_network<Addr: ToSocketAddrs>(ip: Addr) -> BinResult<Self>
pub fn from_reader<R: SeekRead + Send + 'static>(reader: R) -> BinResult<Self>
pub fn get_dir_listing<Hash: Into<Hash40>>( &self, hash: Hash, ) -> Option<&[FileNode]>
Trait Implementations§
Source§impl ArcLookup for ArcFile
impl ArcLookup for ArcFile
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_dir_infos_mut(&mut self) -> &mut [DirInfo]
fn get_file_paths(&self) -> &[FilePath]
fn get_file_info_indices(&self) -> &[FileInfoIndex]
fn get_file_infos(&self) -> &[FileInfo]
fn get_file_infos_mut(&mut self) -> &mut [FileInfo]
fn get_file_info_to_datas(&self) -> &[FileInfoToFileData]
fn get_file_info_to_datas_mut(&mut self) -> &mut [FileInfoToFileData]
fn get_file_datas(&self) -> &[FileData]
fn get_file_datas_mut(&mut self) -> &mut [FileData]
fn get_folder_offsets(&self) -> &[DirectoryOffset]
fn get_folder_offsets_mut(&mut self) -> &mut [DirectoryOffset]
fn get_stream_entries(&self) -> &[StreamEntry]
fn get_stream_file_indices(&self) -> &[u32]
fn get_stream_datas(&self) -> &[StreamData]
fn get_stream_hash_to_entries(&self) -> &[HashToIndex]
fn get_quick_dirs(&self) -> &[QuickDir]
fn get_file_section_offset(&self) -> u64
fn get_stream_section_offset(&self) -> u64
fn get_file_reader<'a>(&'a self) -> Box<dyn SeekRead + 'a>
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_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_file_metadata<Hash: Into<Hash40>>( &self, hash: Hash, region: Region, ) -> Result<FileMetadata, LookupError>
Source§impl BinRead for ArcFile
impl BinRead for ArcFile
Source§fn read_options<R: Read + Seek>(
__binrw_generated_var_reader: &mut R,
__binrw_generated_var_endian: Endian,
__binrw_generated_var_arguments: Self::Args<'_>,
) -> BinResult<Self>
fn read_options<R: Read + Seek>( __binrw_generated_var_reader: &mut R, __binrw_generated_var_endian: Endian, __binrw_generated_var_arguments: Self::Args<'_>, ) -> BinResult<Self>
Source§fn read_be<R>(reader: &mut R) -> Result<Self, Error>
fn read_be<R>(reader: &mut R) -> Result<Self, Error>
Read
Self
from the reader using default arguments and assuming
big-endian byte order. Read moreSource§fn read_le<R>(reader: &mut R) -> Result<Self, Error>
fn read_le<R>(reader: &mut R) -> Result<Self, Error>
Read
Self
from the reader using default arguments and assuming
little-endian byte order. Read moreSource§fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
Read
T
from the reader assuming native-endian byte order. Read moreSource§fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Read
Self
from the reader, assuming big-endian byte order, using the
given arguments. Read moreSource§fn read_le_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_le_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Read
Self
from the reader, assuming little-endian byte order, using
the given arguments. Read moreSource§impl SearchLookup for ArcFile
impl SearchLookup for ArcFile
fn get_folder_path_to_index(&self) -> &[HashToIndex]
fn get_folder_path_list(&self) -> &[FolderPathListEntry]
fn get_path_to_index(&self) -> &[HashToIndex]
fn get_path_list_indices(&self) -> &[u32]
fn get_path_list(&self) -> &[PathListEntry]
fn get_folder_path_index_from_hash( &self, hash: impl Into<Hash40>, ) -> Result<&HashToIndex, LookupError>
fn get_folder_path_entry_from_hash( &self, hash: impl Into<Hash40>, ) -> Result<&FolderPathListEntry, LookupError>
fn get_path_index_from_hash( &self, hash: impl Into<Hash40>, ) -> Result<&HashToIndex, LookupError>
fn get_path_list_index_from_hash( &self, hash: impl Into<Hash40>, ) -> Result<u32, LookupError>
fn get_path_list_entry_from_hash( &self, hash: impl Into<Hash40>, ) -> Result<&PathListEntry, LookupError>
fn get_first_child_in_folder( &self, hash: impl Into<Hash40>, ) -> Result<&PathListEntry, LookupError>
fn get_next_child_in_folder( &self, current_child: &PathListEntry, ) -> Result<&PathListEntry, LookupError>
Auto Trait Implementations§
impl !Freeze for ArcFile
impl RefUnwindSafe for ArcFile
impl Send for ArcFile
impl Sync for ArcFile
impl Unpin for ArcFile
impl UnwindSafe for ArcFile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more