I'm not sure we are talking about the same thing. Slightly adapting the example found in the documentation, you could just perform a naïve linear search on all returned entries and pick whichever one you need: Rust Explorer
Every time I've used PEM, the tools which created the cert created separate files for the public and private parts. I've only had to recover public keys from private keys while developing Blockchain libraries and tools, which have their own (not PEM) formats.
Is there a reason you need to do public key recovery with PEM? Note that ECC is the only widespread algorithm which can do public key recovery, and it's not the only algorithm commonly used with PEM. ECC also requires some extra bits stored with the private key to indicate which of up to 4 solutions is the published public key; I doubt PEM stores those bits.
Okay, so it's actually #3 (OpenSSL's "private" key files contain information for the private and the public key).
Assuming you meant public_key_from_pem, this sounds like it solves your original question exactly. If that is not the case, could you elaborate what problem it doesn't solve that you still need to address?