Skip to content
This repository was archived by the owner on Nov 12, 2023. It is now read-only.
This repository was archived by the owner on Nov 12, 2023. It is now read-only.

XRBK: use generics in errors instead of requiring casting #87

@Antikyth

Description

@Antikyth

I'm not sure if this can work or not, but I wonder if it would be possible to do this kinda thing:

pub enum ReadError<Discrim = u32, Other = Infallible> {
    UnrecognisedDiscriminant(Discrim),
    Other(Other),
}

My concern would be how to define in the e.g. Readable trait - should work with associated types I suppose, main unfortunate part is that associated types can't have defaults.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is neededtaskAn essential task for a planned milestone.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Unassigned

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions