Crates.io | blorb |
lib.rs | blorb |
version | 0.1.0 |
source | src |
created_at | 2016-11-07 06:42:50.753209 |
updated_at | 2016-11-07 06:42:50.753209 |
description | A package for interacting with blorb files. |
homepage | |
repository | https://github.com/thefarwind/blorb-rs.git |
max_upload_size | |
id | 7154 |
size | 71,753 |
A library for using blorb files in rust
This library is an implementation of the Blorb 2.0.4 specification. The specification can be found at the following web address. A copy of the specification can also be found in the top level of this repository.
Blorbs are a resource file type used in Interactive Fiction (IF). They bundle together images, text, sounds, and other resources, along with executable code, for IF interpreters to use.
This library gives access to blorb and blorb file types. It provides structures to examine the contents of blorbs and handle them in a logical way. Additionally, it provides a lazy access interface to the blorb contents, allowing interpreters to use blorbs without handrolling their own way to access the file without dumping the entire contents into memory.
There are three primary interfaces to the blorb filetype provided in this library.
The blorb cursor is implemented by the Blorb
Structure. to create a Blorb
, use the
Blorb<R: Read + Seek>::from_file(file: R)
function. The function constructs a Blorb
object
which manages moved file.
The Blorb
object, when built, does some basic validation of the blorb file, and loads the
resource index and other blorb metadata from the file. It provides a Blorb::load_resource(usize)
method which can then be used to lazily load a blorb resource, such as an image or sound.
If the blorb contains an executable resource, it will be returned from calling
Blorb::load_resource(0)
. The returned value from calling this method is a variant of the Chunk
enum, allowing the handling of the loaded resource to be done with a match
.
The Blorb crate can be build using stable rust 1.12.1 and later.
To build, run the following command:
cargo build
Before any changes are merged in, the following checks should be made:
cargo build
and verify completion without any warningscargo test
and verify completion without any warnings or test failurescargo doc
and verify completion without any issuesrustup run nightly cargo build
and verify completion without any warningsrustup run nightly cargo test
and verify completion without any warnings or test failuresrustup run nightly cargo doc
and verify completion without any issuesrustup run nightly cargo clippy
and verify completion without any warnings