I'm trying to create a custom asset that contains a Cow<'a, str>. Cow requires specifying a lifetime attribute:
#[derive(Debug, Default, Clone, Serialize, Deserialize, TypeUuid, TypePath)]
#[uuid = "4af40b07-f427-46f5-bdb2-f4b6f6c8ccef"]
pub struct StyleCatalog<'a> {
#[serde(flatten)]
styles: HashMap<Cow<'a, str>, Arc<Style<'static>>>,
}
However, the compiler won't let me derive TypePath here. The error I get is lifetime bound not satisfied but lifetime parameter must outlive the static lifetime.
Are there any examples of a custom asset that has a lifetime parameter?