Skip to main content

boa_engine/object/shape/
root_shape.rs

1use boa_macros::{Finalize, Trace};
2
3use super::SharedShape;
4
5/// This is a wrapper around [`SharedShape`] that ensures it's root shape.
6///
7/// Represent the root shape that [`SharedShape`] transitions start from.
8#[derive(Debug, Clone, Trace, Finalize)]
9pub struct RootShape {
10    shape: SharedShape,
11}
12
13impl Default for RootShape {
14    #[inline]
15    fn default() -> Self {
16        Self {
17            shape: SharedShape::root(),
18        }
19    }
20}
21
22impl RootShape {
23    /// Gets the inner [`SharedShape`].
24    #[must_use]
25    pub const fn shape(&self) -> &SharedShape {
26        &self.shape
27    }
28}