Skip to content

Complex type parameters #7

@Gottox

Description

@Gottox

Thanks for this macro!

I'm currently working on a project with massive amounts of traits and I'd like to clean up pages long where clauses. For that trait-set seems to be awesome!

Unfortunately, trait-set doesn't allow me to constraint type parameters like the following:

trait_set::trait_set! {
    pub trait RepresentationBounds = Resource<DynamicType = ()>
        + HasInnerSpec<InnerSpec: HasParent>
}

This works when using blanked implementations:

pub trait RepresentationBounds:
    Resource<DynamicType = ()> + HasInnerSpec<InnerSpec: HasParent>
{
}

impl<T> RepresentationBounds for T
where
    T: Resource<DynamicType = ()> + HasInnerSpec<InnerSpec: HasParent>,
{
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions