Byte_string and serde

https://docs.rs/byte_string/1.0.0/byte_string/struct.ByteString.html

I can't get this code to compile:


#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
pub struct Test {
    x: byte_string::ByteString,
}

According to the docs above, a ByteString is just a Vec<u8> with overloaded Debug. Am I doing something wrong with serde, or does ByteString, for some reason, not support serde?

ByteString has to explicitly implement the serde traits itself for your derive to automatically work. You can ask them to do so, or you can bypass this with a remote derive, accessing its public Vec<u8>.