Skip to content

Add typed property getters mirroring topo_prop_get_* #16

Closed

Description

@smklein

Node::property returns a PropValue enum and asks the caller to pattern-match, which is the right interface when the property's type is unknown, but most callers know exactly what type they expect. As an example, in oxidecomputer/omicron#11279, omicron reads io/instance as a uint32 and ends up with a three-arm match covering the expected variant, any other variant with a warning, and the error case.

The C library has typed getters for this case, topo_prop_get_uint32, topo_prop_get_int32, topo_prop_get_int64, topo_prop_get_uint64, and topo_prop_get_string, and libtopo-sys already binds them. libtopo should surface them as Node::property_u32(group name), property_i32, property_i64, property_u64, and property_string, each returning Result<T, Error> and letting libtopo report a type mismatch as an error rather than having every caller reimplement the check.

Activity

  1. added 5 commits that reference this issue on Sep 16, 2026
    ea153cd
    f6d46fa
    0a453d5
    c1a9125
    5096cf2
  2. added a commit that references this issue on Sep 16, 2026
    24107d4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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