lo48576 / opaque_typedef

Easy opaque typedef for Rust programming language.

Home Page:https://crates.io/crates/opaque_typedef

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple fields support

lo48576 opened this issue · comments

Support outer type with multiple fields.

For example:

trait Validate<T: ?Sized> {
    type Error;
    fn validate(val: &T) -> Result<(), Self::Error>;
}
struct ValidatedString<V: Validate<str>> {
    #[opaque_typedef(inner)]
    inner: String,
    _v: ::std::marker::PhantomData<V>,
}

This feature may be useful with #8.

This feature maybe nealy useless without #8 (generics support), but generics support will be really hard...