Method
as_variant
(&'a self, token: &'a NodeOwner)
Source from the content-addressed store, hash-verified
| 199 | |
| 200 | impl Node { |
| 201 | pub fn as_variant<'a, T>(&'a self, token: &'a NodeOwner) -> Option<&'a T> where T: 'static { |
| 202 | (&*self.variant.ro(token).deref() as &dyn NodeBehavior as &(dyn core::any::Any + 'static)).downcast_ref::<T>() |
| 203 | } |
| 204 | |
| 205 | pub fn as_variant_mut<'a, T>(&'a mut self, token: &'a mut NodeOwner) -> Option<&'a mut T> where T: 'static + Clone { |
| 206 | let x = self.as_variant::<T>(token); |
Callers
nothing calls this directly
Tested by
no test coverage detected