Skip to content

Unify treatment of "flags" #226

Closed
@molpopgen

Description

@molpopgen

Currently, we treat each flag type separately using bitflags!. This approach is okay, but arguably too verbose. We also are not doing anything useful with "node flags", accepting a bare u32 there, making the API inconsistent.

Since node flags allows extra flags specified by the client, we should define NodeFlags and a corresponding From<tsk_flags_t>.

For other flags types, we are not checking for the presence of invalid flags (X::all().contains(y)), which we arguably should be doing.

Further/finally, we are still leaking the C typedef tsk_flags_t into rust via the crate prelude. This should, "of course", be a newtype.

And, speaking of newtypes, all the existing flags types should be repr(transparent) themselves, so that they really are tsk_flags_t at the ABI level.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions