use crate::vm::function::DvmFunction; use crate::vm::virtual_method::DmVirtualMethod; use std::rc::Rc; #[derive(Debug, Eq)] pub struct DvmMethod { function: Rc, implements: Option>, } impl PartialEq for DvmMethod { fn eq(&self, other: &Self) -> bool { self.function == other.function } } impl DvmMethod { pub fn new(dm_fn: DvmFunction, implements: Option>) -> Self { DvmMethod { function: Rc::new(dm_fn), implements, } } pub fn fqn(&self) -> &str { self.function.fqn() } pub fn dm_fn(&self) -> Rc { self.function.clone() } }