1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![allow(missing_docs)] // delete when we move away from the `property` crate.

#[derive(Debug, Clone, PartialEq, property::Property, serde::Serialize)]
#[property(get(public), set(private), mut(disable))]
/// A reference to a component by id (typically unused by user code)
pub struct ComponentReference {
  /// The id of the component.
  pub(crate) id: String,
}

impl ComponentReference {
  /// Create a new [ComponentReference] with specified id.
  pub fn new<T: Into<String>>(id: T) -> Self {
    Self { id: id.into() }
  }
}