Iterate over vector of tuples of enum and arc

pub trait MyTrait: Send + Sync {
    fn service_status(&self) -> ServiceStatus;

pub enum Type {

struct Catalog {
    pub services: Vec<Type>,

impl Catalog {

    pub fn health( &self ) -> Vec<ServiceStatus> {
            .map(| service| {
                match *service {
                    ArcWithRwLock =>,
                    _=> unimplemented!(),


I have a trait that is implemented by multiple trait objects of different types declared in Type enum. I'm trying to iterate over a vec of trait objects and collect results from each objects based on type. But I get the following error-
error[E0599]: no method named read found for type &service::Type in the current scope


123 | ArcWithRwLock =>,

though read() is a valid function.

You need to qualify ArcWithRwLock with the enum type and also capture the inner value:

Type::ArcWithRwLock(ref s) =>,