Skip to main content

FileSystem

Struct FileSystem 

Source
pub struct FileSystem<P: PackFile> { /* private fields */ }
Expand description

Core FileSystem representation holding physical directories and loaded pack files.

Implementations§

Source§

impl<P: PackFile> FileSystem<P>

Source

pub fn load_from_path<G: GameInfoProvider>( game_path: &Path, options: &FileSystemOptions, ) -> Option<Self>

Loads the filesystem from a specific game directory (where gameinfo.txt resides).

Source

pub fn search_path_dirs(&self) -> &HashMap<String, Vec<PathBuf>>

Source

pub fn search_path_dirs_mut(&mut self) -> &mut HashMap<String, Vec<PathBuf>>

Source

pub fn search_path_vpks(&self) -> &HashMap<String, Vec<Arc<P>>>

Source

pub fn search_path_vpks_mut(&mut self) -> &mut HashMap<String, Vec<Arc<P>>>

Source

pub fn find_file(&self, file_path: &str, search_path: &str) -> Option<PathBuf>

Source

pub fn read( &self, file_path: &str, search_path: &str, prioritize_vpks: bool, ) -> Option<Vec<u8>>

Reads data from the internal mounted paths using standard Source Engine priorities.

Source

pub fn read_for_map( &self, map_pack: Option<&P>, file_path: &str, search_path: &str, prioritize_vpks: bool, ) -> Option<Vec<u8>>

Same as read, but takes an optional active map pack file which gets highest priority.

Source

pub fn read_str( &self, file_path: &str, search_path: &str, prioritize_vpks: bool, ) -> Option<String>

Auto Trait Implementations§

§

impl<P> Freeze for FileSystem<P>

§

impl<P> RefUnwindSafe for FileSystem<P>
where P: RefUnwindSafe,

§

impl<P> Send for FileSystem<P>
where P: Sync + Send,

§

impl<P> Sync for FileSystem<P>
where P: Sync + Send,

§

impl<P> Unpin for FileSystem<P>

§

impl<P> UnsafeUnpin for FileSystem<P>

§

impl<P> UnwindSafe for FileSystem<P>
where P: RefUnwindSafe,

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.