Skip to content
This repository has been archived by the owner on May 18, 2022. It is now read-only.

Use a trait for representing attribute values #166

Merged

Conversation

lulf
Copy link
Contributor

@lulf lulf commented Dec 7, 2020

This makes it easier to use attributes in environments where using
static lifetimes for attribute values is challenging by allowing the
attribute service to use its own types that can choose how to store the attribute
values.

In addition, the usage of attribute in the AttributeProvider now takes a
reference to the Attribute instead of a copy to allow the attribute
service more freedom in implementing.

@jonas-schievink Consider this a proposal/draft to provide more flexibility of the attribute API as discussed in #153. I'm still not super-satisfied with this, given that the AttrValue implementation would need to cover all possible values for the different characteristics.

This makes it easier to use attributes in environments where using
static lifetimes for attribute values is challenging by allowing the
attribute service to use its own types that can choose how to store the attribute
values.

In addition, the usage of attribute in the AttributeProvider now takes a
reference to the Attribute instead of a copy to allow the attribute
service more freedom in implementing.
Copy link
Owner

@jonas-schievink jonas-schievink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Certainly seems like a step in the right direction, if we can make it work with more than just a single fixed ValueType.

rubble/src/att/mod.rs Outdated Show resolved Hide resolved
@jonas-schievink jonas-schievink merged commit b0c6832 into jonas-schievink:master Dec 8, 2020
@lulf lulf deleted the refactor-attr-value-api branch December 8, 2020 13:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants