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

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

Open
Antikyth opened this issue Jan 22, 2023 · 0 comments
Open

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

Antikyth opened this issue Jan 22, 2023 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed task An essential task for a planned milestone.

Comments

@Antikyth
Copy link
Collaborator

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.

@Antikyth Antikyth added task An essential task for a planned milestone. help wanted Extra attention is needed enhancement New feature or request labels Jan 22, 2023
@github-project-automation github-project-automation bot moved this to Unassigned in X Rust Bindings Jan 22, 2023
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
enhancement New feature or request help wanted Extra attention is needed task An essential task for a planned milestone.
Projects
Status: Unassigned
Development

No branches or pull requests

1 participant