Skip to content

isentropic-dev/twine-component-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twine Component Template

This is a template for creating a new Twine component in Rust using cargo-generate.

Getting Started

To scaffold a new component from this template, run:

cargo generate isentropic-dev/twine-component-template --name my-component

The --name flag is optional. If omitted, cargo-generate will prompt you for a project name.

After generation:

  1. Navigate to your new project directory:
    cd my-component
  2. Review Cargo.toml and src/lib.rs.
  3. Run the included tests to confirm everything is set up correctly:
    cargo test

Customizing

The included Arithmetic component demonstrates how to define a Twine component with:

  • Custom input and output types
  • A configurable scale parameter
  • Idiomatic error handling using thiserror
  • Basic unit tests

To create your own component:

  1. Use src/lib.rs as a starting point, updating the types as needed.
  2. Rewrite the Component implementation to fit your use case.
  3. Update or replace the tests to validate your component's behavior.

Licensing

This template is licensed under the MIT License (see the included LICENSE file). If you publish a project based on this template under your own name or with different licensing terms, remember to update the LICENSE file accordingly.

About

A template for scaffolding new Twine components in Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages