rustyroad 1.8.0

Rusty Road is a framework written in Rust that is based on Ruby on Rails. It is designed to provide the familiar conventions and ease of use of Ruby on Rails, while also taking advantage of the performance and efficiency of Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Rendering one file of the `products` fixture model.

use super::support::{products, resolve, schema};
use crate::generators::rust::render;

/// Renders one file of the `products` model.
pub(super) fn file(name: &str) -> String {
    let schema = schema();
    let model = resolve(&products(), &schema);

    render::files(&model, &schema)
        .into_iter()
        .find(|file| file.name == name)
        .unwrap_or_else(|| panic!("{name} should be emitted"))
        .contents
}