1
0

25 lines
592 B
Rust
Raw Normal View History

2023-12-01 22:16:50 -05:00
use crate::{BuiltInFunction, Map, Result, Type, TypeDefinition, Value};
2023-11-28 17:54:17 -05:00
pub struct Output;
impl BuiltInFunction for Output {
fn name(&self) -> &'static str {
"output"
}
2023-11-30 02:09:55 -05:00
fn run(&self, arguments: &[Value], _context: &Map) -> Result<Value> {
2023-11-28 17:54:17 -05:00
for argument in arguments {
println!("{argument}");
}
Ok(Value::Empty)
}
2023-12-01 22:16:50 -05:00
fn type_definition(&self) -> crate::TypeDefinition {
TypeDefinition::new(Type::Function {
parameter_types: vec![Type::Any],
return_type: Box::new(Type::Empty),
})
}
2023-11-28 17:54:17 -05:00
}