Atelier: crate atelier_core
This crate provides a Rust native core model for the AWS Smithy Interface Definition Language.
This crate is the foundation for the Atelier set of crates, and provides the following components:
- The model structures themselves that represents a Smithy model This is the in-memory representation shared by all Atelier crates and tools.
- The model builder structures that allow for a fluent and easy construction of a core model.
- The prelude model containing the set of shapes defined in the Smithy specification.
- Traits for reading/writing models in different representations.
- A common
error
module to be used by all Atelier crates.
Example
The following example demonstrates the builder interface to create a model for a simple service. The
service, MessageOfTheDay
has a single resource Message
. The resource has an identifier for the
date, but the read
operation does not make the date member required and so will return the message
for the current date.
use ErrorSource;
use ;
use ;
use ;
*/
Runnable Examples
The example weather.rs
in the examples
directory uses the complete example from the Smithy quick start guide. The
message of the day service shown in the example above is included as a pair of stand-alone examples using the
semantic model and builder APIs.
As usual these can be executed via cargo in the following manner.
Changes
Version 0.2.0
- Major refactor after agreement on the separation of semantic model with Smithy team.
- Only included the semantic model elements
- Reworked trait module
- Made all shape IDs absolute
- Made Builder API create and validate shape IDs.
- Moved UML writer to lib.
Version 0.1.5
- Added
UnwelcomeTerms
linter. - API changes for
ModelReader
andModelWriter
;- removed
representation
method
- removed
- Made
ActionIssue
anstd::error::Error
. - Added
ModelVisitor
toaction
module. - Added
Model::merge
method.
Version 0.1.4
- Completed the
NoOrphanedReferences
validator. - Added
CorrectTypeReferences
validator. - Added
NamingConventions
linter. - Added functions
run_linter_actions
andrun_validation_actions
, and removedValidateAll
type. - Using Regex for identity parsing.
- Moved
REPRESENTATION
torepresentation()
onModelReader
andModelWriter
traits.
Version 0.1.3
- Made debug and uml
Writer
implementations features. - Added module
syntax
for all string constants. - Added all defined
ShapeID
s to the moduleprelude
. - Implemented the foundation for actions, also started on validation.
- Implemented
Model::resolve_id
according to the Smithy spec.
Version 0.1.2
- Updated the model and builder APIs to support JSON and Smithy readers:
- added the
HasMembers
trait for a more un-typed API,
- added the
- Finished the API documentation.
Version 0.1.1
- Updated the model and builder APIs to be more consistent:
- documented method patterns, and ensured they were applied,
- moved from per-type
build
methods to useInto<T>
,
- Added the majority of API documentation.
Version 0.1.0
- First release.
- Initial types for manipulation of Smithy Models, not including selector expressions.
- Initial builder types for fluent construction of models.
- Able to construct the example weather service using the builder API.
TODO
- Complete the prelude model.
- Complete the selector expression types
- More documentation
- More tests