Skip to content

Clarification for implementing Rust-like enums with values, specifically clockid #316

Closed
@monoclex

Description

@monoclex

For the clockid enum, it seems to be an Enum(u32) with four variants. Is the u32 used to represent the value of the clock? The size/alignment is 4, but if the clock reports 4 bytes surely there must be another byte to store the variant? Whilst I understand Rust enums conceptually, to me this doesn't make sense at how I'd implement this in a cross platform manner for other languages. Can this be clarified?

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