You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
libtopo: add typed property getters mirroring topo_prop_get_*
libtopo: add typed property getters mirroring topo_prop_get_*
libtopo: add typed property getters mirroring topo_prop_get_*
libtopo: add typed property getters mirroring topo_prop_get_*
libtopo: add typed property getters mirroring topo_prop_get_*
libtopo: add typed property getters mirroring topo_prop_get_* (#18)