mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2024-11-08 11:01:47 +01:00
pull out args wip
This commit is contained in:
parent
04526c052b
commit
c4edd29f50
@ -39,7 +39,17 @@ pub fn render_fields(fields: &Vec<FullTypeFields>) -> eyre::Result<Option<rust::
|
||||
pub fn $name(
|
||||
&self,
|
||||
$(if let Some(args) = args.as_ref() => $(&args.args))
|
||||
) -> $output {
|
||||
) -> $(&output) {
|
||||
let query = self.selection.select("$(field.name.as_ref())");
|
||||
|
||||
let query = query.arg("args", args).unwrap();
|
||||
|
||||
$output {
|
||||
conn: self.conn.clone(),
|
||||
proc: self.proc.clone(),
|
||||
selection: query,
|
||||
}
|
||||
|
||||
todo!()
|
||||
}
|
||||
});
|
||||
|
@ -20,7 +20,7 @@ impl Handler for Input {
|
||||
.ok_or(eyre::anyhow!("could not find name"))?;
|
||||
let description = render_description(t);
|
||||
|
||||
let input = rust::import("dagger_core", "Input");
|
||||
//let input = rust::import("dagger_core", "Input");
|
||||
|
||||
let fields = match t.input_fields.as_ref() {
|
||||
Some(i) => render_input_fields(i)?,
|
||||
@ -32,8 +32,6 @@ impl Handler for Input {
|
||||
pub struct $name {
|
||||
$(if fields.is_some() => $fields)
|
||||
}
|
||||
|
||||
impl $input for $name {}
|
||||
};
|
||||
|
||||
Ok(out)
|
||||
|
@ -6,14 +6,6 @@ use crate::predicates::{
|
||||
is_custom_scalar_type_ref, is_list_type, is_required_type_ref, is_scalar_type_ref,
|
||||
};
|
||||
|
||||
//fn optional(t: rust::Tokens) -> impl FormatInto<Rust> {
|
||||
// quote_fn! {"Option<$[const](t)>"}
|
||||
//}
|
||||
//
|
||||
//fn required(t: rust::Tokens) -> impl FormatInto<Rust> {
|
||||
// quote_fn! {"$[const](t)"}
|
||||
//}
|
||||
|
||||
pub fn render_type_ref(inner: &TypeRef) -> eyre::Result<rust::Tokens> {
|
||||
let extract_of_type = |t: &TypeRef| -> Option<TypeRef> {
|
||||
return t.clone().of_type.map(|t| *t);
|
||||
|
Loading…
Reference in New Issue
Block a user