[][src]Crate keeshond_datapack

keeshond_datapack lets you easily load resources for your game and cache them in memory, mapped via pathname and accessible by simple numeric ID lookup. Define how they load with the DataObject trait, by implementing a function that takes a Read object. Define where they load from by instantiating a source::Source.

Datapack is used by Keeshond but can work with any engine.

How to use

Pathnames are of the form path/to/file.png. They must match exactly, including the use of one forward slash as a separator, and no separators at the beginning or end. The package name and data type folders are not included (they are implied). Pathnames are also case-sensitive even on platforms with case-insensitive filesystems (Windows, macOS).

Modules

source

The Source trait and implementations.

Structs

DataStore

Storage that allows lookup and access of DataObjects of a given type

Enums

DataError

Return type when failing to load a DataObject from a DataStore

DataStoreOk

Return type when loading information from a DataStore

Traits

DataObject

Represents a data item loaded from a package. Implement this trait to allow the system to load new types of data.

Type Definitions

DataId

A numeric ID used to refer to a DataObject of a specific type.