Struct ArcFile

Source
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§shared_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

Source

pub fn open<P: AsRef<Path>>(path: P) -> BinResult<Self>

Source

pub fn open_over_network<Addr: ToSocketAddrs>(ip: Addr) -> BinResult<Self>

Source

pub fn from_reader<R: SeekRead + Send + 'static>(reader: R) -> BinResult<Self>

Source

pub fn get_dir_listing<Hash: Into<Hash40>>( &self, hash: Hash, ) -> Option<&[FileNode]>

Trait Implementations§

Source§

impl ArcLookup for ArcFile

Source§

fn get_file_info_buckets(&self) -> &[FileInfoBucket]

Source§

fn get_file_hash_to_path_index(&self) -> &[HashToIndex]

Source§

fn get_dir_hash_to_info_index(&self) -> &[HashToIndex]

Source§

fn get_dir_infos(&self) -> &[DirInfo]

Source§

fn get_dir_infos_mut(&mut self) -> &mut [DirInfo]

Source§

fn get_file_paths(&self) -> &[FilePath]

Source§

fn get_file_info_indices(&self) -> &[FileInfoIndex]

Source§

fn get_file_infos(&self) -> &[FileInfo]

Source§

fn get_file_infos_mut(&mut self) -> &mut [FileInfo]

Source§

fn get_file_info_to_datas(&self) -> &[FileInfoToFileData]

Source§

fn get_file_info_to_datas_mut(&mut self) -> &mut [FileInfoToFileData]

Source§

fn get_file_datas(&self) -> &[FileData]

Source§

fn get_file_datas_mut(&mut self) -> &mut [FileData]

Source§

fn get_folder_offsets(&self) -> &[DirectoryOffset]

Source§

fn get_folder_offsets_mut(&mut self) -> &mut [DirectoryOffset]

Source§

fn get_stream_entries(&self) -> &[StreamEntry]

Source§

fn get_stream_file_indices(&self) -> &[u32]

Source§

fn get_stream_datas(&self) -> &[StreamData]

Source§

fn get_stream_hash_to_entries(&self) -> &[HashToIndex]

Source§

fn get_quick_dirs(&self) -> &[QuickDir]

Source§

fn get_file_section_offset(&self) -> u64

Source§

fn get_stream_section_offset(&self) -> u64

Source§

fn get_shared_section_offset(&self) -> u64

Source§

fn get_file_reader<'a>(&'a self) -> Box<dyn SeekRead + 'a>

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>

Source§

impl BinRead for ArcFile

Source§

type Args<'__binrw_generated_args_lifetime> = ()

The type used for the args parameter of read_args() and read_options(). Read more
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>

Read Self from the reader using the given Endian and arguments. Read more
Source§

fn read_be<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek, Self::Args<'a>: for<'a> Required,

Read Self from the reader using default arguments and assuming big-endian byte order. Read more
Source§

fn read_le<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek, Self::Args<'a>: for<'a> Required,

Read Self from the reader using default arguments and assuming little-endian byte order. Read more
Source§

fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek, Self::Args<'a>: for<'a> Required,

Read T from the reader assuming native-endian byte order. Read more
Source§

fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
where R: Read + Seek,

Read Self from the reader, assuming big-endian byte order, using the given arguments. Read more
Source§

fn read_le_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
where R: Read + Seek,

Read Self from the reader, assuming little-endian byte order, using the given arguments. Read more
Source§

fn read_ne_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
where R: Read + Seek,

Read T from the reader, assuming native-endian byte order, using the given arguments. Read more
Source§

fn after_parse<R>( &mut self, _: &mut R, _: Endian, _: Self::Args<'_>, ) -> Result<(), Error>
where R: Read + Seek,

Runs any post-processing steps required to finalize construction of the object. Read more
Source§

impl ReadMagic for ArcFile

Source§

const MAGIC: Self::MagicType = {transmute(0xabcdef9876543210): <arc_file::ArcFile as binrw::meta::ReadMagic>::MagicType}

The magic number.
Source§

type MagicType = u64

The type of the magic number.
Source§

impl SearchLookup for ArcFile

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<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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.