mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 06:16:04 +00:00
26 lines
561 B
Rust
Executable file
26 lines
561 B
Rust
Executable file
use crate::{style::Style, FormattedText};
|
|
use serde::Serialize;
|
|
|
|
#[derive(Clone, Debug, PartialEq, Serialize, Eq, Hash)]
|
|
pub struct BaseComponent {
|
|
// implements mutablecomponent
|
|
#[serde(skip_serializing_if = "Vec::is_empty")]
|
|
pub siblings: Vec<FormattedText>,
|
|
#[serde(flatten)]
|
|
pub style: Style,
|
|
}
|
|
|
|
impl BaseComponent {
|
|
pub fn new() -> Self {
|
|
Self {
|
|
siblings: Vec::new(),
|
|
style: Style::default(),
|
|
}
|
|
}
|
|
}
|
|
|
|
impl Default for BaseComponent {
|
|
fn default() -> Self {
|
|
Self::new()
|
|
}
|
|
}
|