diff --git a/minijinja/src/value/object.rs b/minijinja/src/value/object.rs index 92364fa3..abd84628 100644 --- a/minijinja/src/value/object.rs +++ b/minijinja/src/value/object.rs @@ -76,3 +76,21 @@ pub trait Object: fmt::Display + fmt::Debug + Any + Sync + Send { )) } } + +impl Object for std::sync::Arc { + fn get_attr(&self, name: &str) -> Option { + T::get_attr(self, name) + } + + fn attributes(&self) -> Box + '_> { + T::attributes(self) + } + + fn call_method(&self, state: &State, name: &str, args: &[Value]) -> Result { + T::call_method(self, state, name, args) + } + + fn call(&self, state: &State, args: &[Value]) -> Result { + T::call(self, state, args) + } +}