use crate::{Signature, Value}; use nu_source::Spanned; use std::fmt::Debug; pub trait VariableRegistry { fn get_variable(&self, name: &Spanned<&str>) -> Option; fn variables(&self) -> Vec; } pub trait SignatureRegistry: Debug { fn names(&self) -> Vec; fn has(&self, name: &str) -> bool; fn get(&self, name: &str) -> Option; fn clone_box(&self) -> Box; } impl SignatureRegistry for Box { fn names(&self) -> Vec { (&**self).names() } fn has(&self, name: &str) -> bool { (&**self).has(name) } fn get(&self, name: &str) -> Option { (&**self).get(name) } fn clone_box(&self) -> Box { (&**self).clone_box() } }