pub struct ComponentTree {
pub name: String,
pub abi: String,
pub props: Vec<String>,
pub state: Map<String, Value>,
pub live: BTreeMap<String, LiveDecl>,
pub uses: Vec<String>,
pub bus: BTreeMap<String, String>,
pub handlers: String,
pub tree: Vec<Node>,
pub css: Option<String>,
pub keys: Vec<KeyDecl>,
}Expand description
A component’s compiled tree — components/<name>.json.
Fields§
§name: String§abi: String§props: Vec<String>§state: Map<String, Value>The declared state: its initial value (a map).
live: BTreeMap<String, LiveDecl>§uses: Vec<String>§bus: BTreeMap<String, String>FRAME-12: what it hears on the bus — topic → fold (on("topic", "fold")); none when the tree has no bus.
handlers: StringThe sha256 of components/<name>.rhai.
tree: Vec<Node>§css: Option<String>FRAME-30: its sheet’s mark (components/<name>.css scoped under
<name>[data-css="<mark>"]); none when it has no sheet.
keys: Vec<KeyDecl>FRAME-36: its shortcuts (keys(#{ … }), the tree’s keys), by
chord; none when the tree has no keys.
Implementations§
Source§impl ComponentTree
impl ComponentTree
Sourcepub fn parse(json: &str) -> Result<Self, TreeError>
pub fn parse(json: &str) -> Result<Self, TreeError>
From components/<name>.json’s text; refused, naming where, when it
is not the contract’s schema or an expression does not compile.
Trait Implementations§
Source§impl Clone for ComponentTree
impl Clone for ComponentTree
Source§impl Debug for ComponentTree
impl Debug for ComponentTree
Source§impl PartialEq for ComponentTree
impl PartialEq for ComponentTree
impl StructuralPartialEq for ComponentTree
Auto Trait Implementations§
impl Forget for ComponentTree
impl Freeze for ComponentTree
impl Move for ComponentTree
impl RefUnwindSafe for ComponentTree
impl Send for ComponentTree
impl Sync for ComponentTree
impl Unpin for ComponentTree
impl UnsafeUnpin for ComponentTree
impl UnwindSafe for ComponentTree
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Variant for T
impl<T> Variant for T
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert this
Variant trait object to &mut dyn Any.Source§fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
Convert this
Variant trait object to Box<dyn Any>.