I have a variable which is an Arc. I want to do a match on the cases of the enum. If I de-reference the enum in the match, the match syntax implies a copy, which isn't allowed because the item has a mutex inside and isn't copyable. I tried putting "as ref" in the pattern's data field, but that's not allowed either.
If I don't de-reference the enum, I have to write match patterns with an Arc enclosing each enum type. Is that even possible? The obvious syntax doesn't work.
This kind of destructuring doesn't seem to be covered in the documentation.
Either this is easy, or not supported, I suspect.
(Use case: refactoring a big program, which included putting a mutex inside something that previously was copyable.)