Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt at changing ItemId struct into a trait, and passing ItemIdT type parameter around. #181

Merged
merged 7 commits into from
Feb 1, 2024
12 changes: 12 additions & 0 deletions crate/core/src/item_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ use serde::{Deserialize, Serialize};
/// let _camel = item_id!("camelCase");
/// let _pascal = item_id!("PascalCase");
/// ```
///
/// # Design Note
///
/// TODO: Experiment with upgrades.
///
/// For backward compatibility and migrating items from old IDs to new IDs, e.g.
/// when they were deployed with an old version of the automation software,
/// there needs to be a way to:
///
/// * Read state using the old ID.
/// * Either clean up that state, or migrate that state into an Item with the
/// new ID.
#[derive(Clone, Debug, Hash, PartialEq, Eq, Deserialize, Serialize)]
pub struct ItemId(Cow<'static, str>);

Expand Down
Loading