mrml/mj_breakpoint/
mod.rs

1use std::marker::PhantomData;
2
3use crate::prelude::{Component, StaticTag};
4
5#[cfg(feature = "json")]
6mod json;
7#[cfg(feature = "parse")]
8mod parse;
9#[cfg(feature = "print")]
10mod print;
11
12pub const NAME: &str = "mj-breakpoint";
13
14#[derive(Clone, Debug, Default)]
15#[cfg_attr(feature = "json", derive(serde::Serialize, serde::Deserialize))]
16pub struct MjBreakpointAttributes {
17    #[cfg_attr(feature = "json", serde(skip_serializing_if = "String::is_empty"))]
18    pub width: String,
19}
20
21pub struct MjBreakpointTag;
22
23impl StaticTag for MjBreakpointTag {
24    fn static_tag() -> &'static str {
25        NAME
26    }
27}
28
29pub type MjBreakpoint = Component<PhantomData<MjBreakpointTag>, MjBreakpointAttributes, ()>;
30
31impl MjBreakpoint {
32    pub fn value(&self) -> &str {
33        &self.attributes.width
34    }
35}