mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2025-03-31 20:45:36 +02:00
* format code * with object gen and args * add implementation * add rust generator * reset generated code * add basic output * reset output * add object * add format function * with opts * fix vec * add context to unwrap * fix arguments * with function body * first complete generation: Still missing Vec<Obj> * run full alpine * add roadmap item
26 lines
652 B
Rust
26 lines
652 B
Rust
mod functions;
|
|
mod generator;
|
|
pub mod rust;
|
|
pub mod utility;
|
|
mod visitor;
|
|
|
|
use dagger_core::introspection::Schema;
|
|
|
|
use self::generator::DynGenerator;
|
|
|
|
fn set_schema_parents(mut schema: Schema) -> Schema {
|
|
for t in schema.types.as_mut().into_iter().flatten().flatten() {
|
|
let t_parent = t.full_type.clone();
|
|
for mut field in t.full_type.fields.as_mut().into_iter().flatten() {
|
|
field.parent_type = Some(t_parent.clone());
|
|
}
|
|
}
|
|
|
|
return schema;
|
|
}
|
|
|
|
pub fn generate(schema: Schema, generator: DynGenerator) -> eyre::Result<String> {
|
|
let schema = set_schema_parents(schema);
|
|
generator.generate(schema)
|
|
}
|