Struct uasset::AssetHeader

source ·
pub struct AssetHeader<R> {
Show 33 fields pub archive: Archive<R>, pub total_header_size: i32, pub folder_name: String, pub package_flags: u32, pub names: Vec<String>, pub soft_object_paths_count: i32, pub soft_object_paths_offset: i32, pub localization_id: Option<String>, pub gatherable_text_data_count: i32, pub gatherable_text_data_offset: i32, pub export_count: i32, pub export_offset: i32, pub imports: Vec<ObjectImport>, pub depends_offset: i32, pub soft_package_references_count: i32, pub soft_package_references_offset: i32, pub searchable_names_offset: Option<i32>, pub thumbnail_table_offset: i32, pub engine_version: UnrealEngineVersion, pub compatible_with_engine_version: UnrealEngineVersion, pub compression_flags: u32, pub package_source: u32, pub additional_packages_to_cook: Vec<String>, pub texture_allocations: Option<i32>, pub asset_registry_data_offset: i32, pub bulk_data_start_offset: i64, pub world_tile_info_data_offset: Option<i32>, pub chunk_ids: Vec<i32>, pub preload_dependency_count: i32, pub preload_dependency_offset: i32, pub names_referenced_from_export_data_count: i32, pub payload_toc_offset: i64, pub data_resource_offset: Option<i32>,
}
Expand description

A table of contents for a uasset loaded from disk, containing all the shared package summary information. This roughly maps to FPackageFileSummary in Engine/Source/Runtime/CoreUObject/Public/UObject/PackageFileSummary.h, except we load some of the indirectly referenced data (i.e. names, imports, exports).

Fields§

§archive: Archive<R>§total_header_size: i32

Full size of the asset header (C++ name: TotalHeaderSize)

§folder_name: String

The “Generic Browser” folder name that it lives in (C++ name: FolderName)

§package_flags: u32

Package flags like whether this was serialized for the editor (C++ name: PackagesFlags)

§names: Vec<String>

Table of names used by this asset (C++ name: NameCount and NameOffset)

§soft_object_paths_count: i32

Number of soft object paths references contained in this package (C++ name: SoftObjectPathsCount)

§soft_object_paths_offset: i32

Location into the file on disk for the soft object paths reference list (C++ name: SoftObjectPathsOffset)

§localization_id: Option<String>

Localization ID for this package (C++ name: LocalizationId)

§gatherable_text_data_count: i32

Number of gatherable text data entries (C++ name: GatherableTextDataCount)

§gatherable_text_data_offset: i32

Location on disk of gatherable text data entries (C++ name: GatherableTextDataOffset)

§export_count: i32

Number of ExportMap entries (C++ name: ExportCount)

§export_offset: i32

Location on disk of the ExportMap data (C++ name: ExportOffset)

§imports: Vec<ObjectImport>

Imports (dependencies) listed by this asset (C++ name: ImportCount and ImportOffset)

§depends_offset: i32

Location of DependsMap data (C++ name: DependsOffset)

§soft_package_references_count: i32

Number of soft package references that are listed (C++ name: SoftPackageReferencesCount)

§soft_package_references_offset: i32

Location on disk of the soft package references (C++ name: SoftPackageReferencesOffset)

§searchable_names_offset: Option<i32>

Location of SearchableNamesMap data (C++ name: SearchableNamesOffset)

§thumbnail_table_offset: i32

Offset of the thumbnail table (C++ name: ThumbnailTableOffset)

§engine_version: UnrealEngineVersion

Information about the engine version the asset was saved with (C++ name: SavedByEngineVersion)

§compatible_with_engine_version: UnrealEngineVersion

Information about the engine version the asset is compatible with (for hotfix support) (C++ name: CompatibleWithEngineVersion)

§compression_flags: u32

Flags dictating compression settings for this asset (C++ name: CompressionFlags)

§package_source: u32

This is a random number in assets created by the shipping build of the editor, and a crc32 of the uppercased filename otherwise. Weird. Used to determine if an asset was made “by a modder or by Epic (or licensee)”. (C++ name: PackageSource)

§additional_packages_to_cook: Vec<String>

No longer used

§texture_allocations: Option<i32>

No longer used

§asset_registry_data_offset: i32

Location on disk of the asset registry tag data (C++ name: AssetRegistryDataOffset)

§bulk_data_start_offset: i64

Offset to the location in the file where the bulkdata starts (C++ name: BulkDataStartOffset)

§world_tile_info_data_offset: Option<i32>

Offset to the location in the file where the FWorldTileInfo data starts (C++ name: WorldTileInfoDataOffset)

§chunk_ids: Vec<i32>

Streaming install ChunkIDs (C++ name: ChunkIDs)

§preload_dependency_count: i32

Number of preload dependency data entries (C++ name: PreloadDependencyCount)

§preload_dependency_offset: i32

Location into the file on disk for the preload dependency data (C++ name: PreloadDependencyOffset)

§names_referenced_from_export_data_count: i32

Number of names that are referenced from serialized export data (sorted first in the name map) (C++ name: NamesReferencedFromExportDataCount`)

§payload_toc_offset: i64

Location into the file on disk for the payload table of contents data (C++ name: PayloadTocOffset)

§data_resource_offset: Option<i32>

Location into the file of the data resource(s) (C++ name: DataResourceOffset )

Implementations§

source§

impl<R> AssetHeader<R>where R: Seek + Read,

source

pub fn new(reader: R) -> Result<Self>

Parse an AssetHeader from the given reader, assuming a little endian uasset

source§

impl<R> AssetHeader<R>

source

pub fn find_name(&self, find_name: &str) -> Option<NameReference>

Attempt to look up find_name in the name table serialized in AssetHeader::names, will return None if the name does not exist. Names are case insensitive.

source

pub fn resolve_name<'a>( &'a self, name_reference: &NameReference ) -> Result<Cow<'a, str>, InvalidNameIndexError>

Look up the string representation for a given NameReference.

source

pub fn package_import_iter(&self) -> ImportIterator<'_, R>

Create an iterator over the names of just the packages imported by this asset (i.e. its dependencies).

source§

impl<R> AssetHeader<R>where R: Seek + Read,

source

pub fn thumbnail_iter( &mut self ) -> Result<UnrealArrayIterator<'_, UnrealThumbnailInfo, R>>

Create an iterator over the names of just the packages imported by this asset (i.e. its dependencies).

Trait Implementations§

source§

impl<R: Debug> Debug for AssetHeader<R>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<R> RefUnwindSafe for AssetHeader<R>where R: RefUnwindSafe,

§

impl<R> Send for AssetHeader<R>where R: Send,

§

impl<R> Sync for AssetHeader<R>where R: Sync,

§

impl<R> Unpin for AssetHeader<R>where R: Unpin,

§

impl<R> UnwindSafe for AssetHeader<R>where R: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.