this is hte part of code:
impl<Func, FunctionArgs> From<Func> for Function
where
Func: Fn(FunctionArgs) + 'static,
FunctionArgs: JsonSchema,
{
fn from(function: Func) -> Self {
let schema = schema_for!(FunctionArgs);
let fn_type_name = type_name_of_val(&function);
let parameters = serde_json::to_value(schema)
.unwrap_or_else(|_| panic!("Failed to serialize schema for function {}", fn_type_name));
let fn_name = fn_type_name.split("::").last().unwrap_or("");
Self {
name: fn_name.to_string(),
description: match parameters.get("description") {
Some(Value::String(s)) => Some(s.clone()),
_ => None,
},
parameters,
}
}
}
i cant understand what this compiler message means, ive tried just having a from function without implementing the From trait and that worked but doing it in a trait doesnt seem to work