pub struct LumpInfo {
pub pos: i32,
pub size: i32,
pub name: [u8; 8],
pub id: [u8; 12],
pub state: LumpState,
}Expand description
Represents the lump official metadata (16 bytes)
and the WAD operations state (from WadOp)
Fields§
§pos: i32The lump start position in the file buffer (4 bytes)
size: i32The lump size in bytes (4 bytes)
name: [u8; 8]Lump name, it only contains in theory [A-Z][0-9] (8 bytes)
id: [u8; 12]Lumps name are not unique but we want to extract them into files
The attribute acts like an unique ID
state: LumpStateLump state
Implementations§
Source§impl LumpInfo
impl LumpInfo
pub fn new(pos: i32, size: i32, name: [u8; 8]) -> Self
Sourcepub fn name_ascii(&self) -> String
pub fn name_ascii(&self) -> String
Get the name filtered by ascii characters only
Sourcepub fn is_overwritable(&self) -> bool
pub fn is_overwritable(&self) -> bool
Returns if the metadata is overwritable
Because specials lumps cannot be overwritten when we build a new WAD file (output) like the separators
Trait Implementations§
impl Copy for LumpInfo
Auto Trait Implementations§
impl Freeze for LumpInfo
impl RefUnwindSafe for LumpInfo
impl Send for LumpInfo
impl Sync for LumpInfo
impl Unpin for LumpInfo
impl UnwindSafe for LumpInfo
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().