pub struct Trn {
pub file_type: FixedSizeString<4>,
pub version_major: u16,
pub version_minor: u16,
pub packets: Vec<PacketData>,
}Expand description
TRN file
Fields§
§file_type: FixedSizeString<4>TRN file type (TRN, TRX)
version_major: u16TRN file version
version_minor: u16TRN file version
packets: Vec<PacketData>TRN packets
Implementations§
Source§impl Trn
impl Trn
Sourcepub fn from_bytes_head(input: &[u8]) -> NWNParseResult<'_, Self>
pub fn from_bytes_head(input: &[u8]) -> NWNParseResult<'_, Self>
Parse the top of the TRN file, without loading / parsing all packets. Packets will be of type PacketData::Offset
Sourcepub fn load_offsets(
&mut self,
buffer: &[u8],
buffer_offset: u32,
) -> NWNParseResult<'_, ()>
pub fn load_offsets( &mut self, buffer: &[u8], buffer_offset: u32, ) -> NWNParseResult<'_, ()>
Call PacketData::load_offset on all offset data (skipping non-offset packet data)
Sourcepub fn parse_offsets(
&mut self,
buffer: &[u8],
buffer_offset: u32,
) -> NWNParseResult<'_, ()>
pub fn parse_offsets( &mut self, buffer: &[u8], buffer_offset: u32, ) -> NWNParseResult<'_, ()>
Call PacketData::parse_offset on all offset data (skipping non-offset packet data)
Sourcepub fn from_bytes(input: &[u8]) -> NWNParseResult<'_, Self>
pub fn from_bytes(input: &[u8]) -> NWNParseResult<'_, Self>
Parse the entire TRN file and each of its packets. Packets will be of type PacketData::Parsed
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Trn
impl RefUnwindSafe for Trn
impl Send for Trn
impl Sync for Trn
impl Unpin for Trn
impl UnwindSafe for Trn
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