[−][src]Struct nitro_fs::fnt::Directory
Represents a NitroROM directory.
Notes
path
will be the full path relative to the root of the
file name table.
value
for the root directory is the number of directories
in the file name table. For non-root directories, it is the
ID of the directory's parent.
Because the root directory has no parent ID value, a parent_id
call on the root directory will return ROOT_ID
.
Fields
path: PathBuf
Name of the directory
files: Vec<FileEntry>
Implementations
impl Directory
[src]
pub fn new<R: Read>(reader: &mut R, id: u16) -> Result<Self, Error>
[src]
pub fn set_path<P: AsRef<Path>>(&mut self, path: P)
[src]
Sets the full path that this directory is referenced by.
pub fn offset(&self) -> u32
[src]
The offset into the FNT where this directory's info is stored.
pub fn id(&self) -> u16
[src]
The ID of the directory.
pub fn start_id(&self) -> u16
[src]
The ID of the first file in the directory's subtable.
pub fn parent_id(&self) -> u16
[src]
The ID of the parent directory.
If this is the root directory, ROOT_ID
will be returned instead.
pub fn is_root(&self) -> bool
[src]
Whether this directory is the root.
pub fn append_file(&mut self, file: FileEntry)
[src]
Appends a file to the file list associated with this directory.
pub fn append_files(&mut self, files: &[FileEntry])
[src]
Appends several files to the list associated with this directory.
Trait Implementations
impl Clone for Directory
[src]
impl Debug for Directory
[src]
impl Eq for Directory
[src]
impl Hash for Directory
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Directory
[src]
fn cmp(&self, other: &Directory) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Directory> for Directory
[src]
impl PartialOrd<Directory> for Directory
[src]
fn partial_cmp(&self, other: &Directory) -> Option<Ordering>
[src]
fn lt(&self, other: &Directory) -> bool
[src]
fn le(&self, other: &Directory) -> bool
[src]
fn gt(&self, other: &Directory) -> bool
[src]
fn ge(&self, other: &Directory) -> bool
[src]
impl StructuralEq for Directory
[src]
impl StructuralPartialEq for Directory
[src]
Auto Trait Implementations
impl RefUnwindSafe for Directory
impl Send for Directory
impl Sync for Directory
impl Unpin for Directory
impl UnwindSafe for Directory
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,