#model #smithy #merge #assembly #single #different #in-memory

atelier_assembler

Implements the Smithy model assembler pattern, to merge files into a single in-memory Model

5 releases

0.1.4 Jul 12, 2021
0.1.3 Jun 25, 2021
0.1.2 Jun 25, 2021
0.1.1 May 3, 2021
0.1.0 Apr 30, 2021

#765 in Filesystem

Download history 937/week @ 2024-03-13 664/week @ 2024-03-20 659/week @ 2024-03-27 833/week @ 2024-04-03 618/week @ 2024-04-10 647/week @ 2024-04-17 575/week @ 2024-04-24 516/week @ 2024-05-01 709/week @ 2024-05-08 652/week @ 2024-05-15 587/week @ 2024-05-22 866/week @ 2024-05-29 1191/week @ 2024-06-05 1145/week @ 2024-06-12 660/week @ 2024-06-19 1120/week @ 2024-06-26

4,266 downloads per month
Used in 37 crates (2 directly)

MIT license

580KB
11K SLoC

Atelier: crate atelier_assembler

This crate provides the model assembly capability, to merge files into a single in-memory Model.

crates.io docs.rs

A tool can add files one-by-one, or from a directory, and then process them all into a single model. This implementation understands the different registered file extensions so that it can read files in different representations and assemble them seamlessly.

Example

The following is the simple, and most common, method of using the assembler. This uses the default FileTypeRegistry and will search for all models in the set of paths specified in the environment variable "SMITHY_PATH".

use atelier_assembler::ModelAssembler;
use atelier_core::error::Result;
use atelier_core::model::Model;
use std::convert::TryFrom;

let env_assembler = ModelAssembler::default();

let model: Result<Model> = Model::try_from(env_assembler);

For more information, see the Rust Atelier book.

Changes

Version 0.1.4

  • Refactored constructors for ModelAssembler, just one 'new' function now.

Version 0.1.3

  • Added validation for swaits' resolver test.

Version 0.1.2

Version 0.1.1

  • Refactored to produce:
    • A FileReader function type that parses a file type.
    • A FileType that matches a name, reader, and MIME type.
    • A FileTypeRegistry that matches one or more file extensions to a file type.

Version 0.1.0

  • Extracted from the atelier_lib crate.

Dependencies

~8–11MB
~206K SLoC