diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-12-15 22:51:55 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-12-15 23:11:20 +0100 |
| commit | b6202b646a0d5ecced301d9bac8bfcaf977d7ee4 (patch) | |
| tree | 7d42cb50f9e66153e7e8b2217009684e25f54f42 /src/model/content.rs | |
| parent | f3980c704544a464f9729cc8bc9f97d3a7454769 (diff) | |
Reflection for castables
Diffstat (limited to 'src/model/content.rs')
| -rw-r--r-- | src/model/content.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/model/content.rs b/src/model/content.rs index e73fa4a8..df910a58 100644 --- a/src/model/content.rs +++ b/src/model/content.rs @@ -11,7 +11,8 @@ use thin_vec::ThinVec; use typst_macros::node; use super::{ - capability, capable, Args, Guard, Key, Property, Recipe, Style, StyleMap, Value, Vm, + capability, capable, Args, Guard, Key, ParamInfo, Property, Recipe, Style, StyleMap, + Value, Vm, }; use crate::diag::{SourceResult, StrResult}; use crate::syntax::Span; @@ -426,6 +427,11 @@ pub trait Node: 'static + Capable { where Self: Sized; + /// List the settable properties. + fn properties() -> Vec<ParamInfo> + where + Self: Sized; + /// Access a field on this node. fn field(&self, name: &str) -> Option<Value>; } |
