I want to call this function in a 3rd party library (xmltree-rs):
pub fn parse(r: R) -> Element {
The expected use case is to
To find out what implements a trait, go to the bottom of the page for that trait.
In this case, the most promising looking implementers are &'a [u8]
and Cursor<Vec<u8>>
.
You can obtain a &[u8]
from a &str
or String
by calling as_bytes(), taking note of automatic dereferencing and Deref on String
s. Alternatively, you could use a byte literal if you are only using the ASCII subset.