pub struct Erf {
pub file_type: ErfFileType,
pub build_year: u32,
pub build_day: u32,
pub description_strref: StrRef,
pub reserved: [u8; 116],
pub localized_strings: Vec<ErfLocalizedString>,
pub resources: Vec<ErfResource>,
}Expand description
In-memory ERF-family container.
Fields§
§file_type: ErfFileTypeContainer signature.
build_year: u32Build year (years since 1900).
build_day: u32Build day of year (1..=366).
description_strref: StrRefDescription TLK string reference (StrRef::invalid() when absent).
reserved: [u8; 116]Reserved 116-byte block at header offset 0x2C–0x9F.
Confirmed engine-dead by Ghidra analysis of AddEncapsulatedContents
(0x0040f3c0): the full 160-byte header is read into a stack buffer but
only offsets 0x00, 0x04, 0x10, and 0x18 are subsequently accessed.
Preserved verbatim for lossless roundtrip; new files initialize to zero.
localized_strings: Vec<ErfLocalizedString>Localized description entries.
resources: Vec<ErfResource>Ordered archive resources.
Implementations§
Source§impl Erf
impl Erf
Sourcepub fn new(file_type: ErfFileType) -> Self
pub fn new(file_type: ErfFileType) -> Self
Creates an empty archive for file_type.
Sourcepub fn push_resource(
&mut self,
resref: ResRef,
resource_type: ResourceTypeCode,
data: Vec<u8>,
)
pub fn push_resource( &mut self, resref: ResRef, resource_type: ResourceTypeCode, data: Vec<u8>, )
Appends one resource entry.
Trait Implementations§
Source§impl DecodeBinary for Erf
impl DecodeBinary for Erf
Source§type Error = ErfBinaryError
type Error = ErfBinaryError
Error type used by the format.
Source§impl EncodeBinary for Erf
impl EncodeBinary for Erf
impl Eq for Erf
impl StructuralPartialEq for Erf
Auto Trait Implementations§
impl Freeze for Erf
impl RefUnwindSafe for Erf
impl Send for Erf
impl Sync for Erf
impl Unpin for Erf
impl UnwindSafe for Erf
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> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> StrictAs for T
impl<T> StrictAs for T
Source§fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
Casts the value.
Source§impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
Source§fn strict_cast_from(src: Src) -> Dst
fn strict_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.