summaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-11-21 13:56:25 +0100
committerLaurenz <laurmaedje@gmail.com>2022-11-21 14:00:37 +0100
commit36ea0b05c9986288eec8bc4a6b35a89b6ea0d3f4 (patch)
tree947f463758adc80e265dbbb24eda21cff4b6e8be /src/model
parent7c7b8302251e9703b086c9bf5a989982535bc25b (diff)
Refactor proc macros
Diffstat (limited to 'src/model')
-rw-r--r--src/model/content.rs12
-rw-r--r--src/model/mod.rs2
2 files changed, 8 insertions, 6 deletions
diff --git a/src/model/content.rs b/src/model/content.rs
index 210b8bde..c28082c2 100644
--- a/src/model/content.rs
+++ b/src/model/content.rs
@@ -281,6 +281,12 @@ pub trait Node: 'static {
Content(Arc::new(self), vec![], None)
}
+ /// A unique identifier of the node type.
+ fn id(&self) -> NodeId;
+
+ /// The node's name.
+ fn name(&self) -> &'static str;
+
/// Construct a node from the arguments.
///
/// This is passed only the arguments that remain after execution of the
@@ -300,12 +306,6 @@ pub trait Node: 'static {
/// Access a field on this node.
fn field(&self, name: &str) -> Option<Value>;
- /// A unique identifier of the node type.
- fn id(&self) -> NodeId;
-
- /// The node's name.
- fn name(&self) -> &'static str;
-
/// Extract the pointer of the vtable of the trait object with the
/// given type `id` if this node implements that trait.
fn vtable(&self, id: TypeId) -> Option<*const ()>;
diff --git a/src/model/mod.rs b/src/model/mod.rs
index 20bca106..0f946a40 100644
--- a/src/model/mod.rs
+++ b/src/model/mod.rs
@@ -23,6 +23,8 @@ mod ops;
mod scope;
mod vm;
+#[doc(hidden)]
+pub use once_cell;
pub use typst_macros::{capability, node};
pub use self::args::*;