git.delta.rocks / unique-network / refs/commits / 3903c8aaf16e

difftreelog

source

primitives/rmrk-traits/src/theme.rs1.2 KiBsourcehistory
1use codec::{Decode, Encode};2use scale_info::TypeInfo;34#[cfg(feature = "std")]5use serde::Serialize;67#[cfg(feature = "std")]8use crate::serialize;910#[cfg_attr(feature = "std", derive(Eq, Serialize))]11#[derive(Encode, Decode, Debug, TypeInfo, Clone, PartialEq)]12#[cfg_attr(13	feature = "std",14	serde(bound = r#"15			BoundedString: AsRef<[u8]>,16			PropertyList: AsRef<[ThemeProperty<BoundedString>]>,17		"#)18)]19pub struct Theme<BoundedString, PropertyList> {20	/// Name of the theme21	#[cfg_attr(feature = "std", serde(with = "serialize::vec"))]22	pub name: BoundedString,2324	/// Theme properties25	#[cfg_attr(feature = "std", serde(with = "serialize::vec"))]26	pub properties: PropertyList,27	/// Inheritability28	pub inherit: bool,29}3031#[cfg_attr(feature = "std", derive(Eq, Serialize))]32#[derive(Encode, Decode, Debug, TypeInfo, Clone, PartialEq)]33#[cfg_attr(feature = "std", serde(bound = "BoundedString: AsRef<[u8]>"))]34pub struct ThemeProperty<BoundedString> {35	/// Key of the property36	#[cfg_attr(feature = "std", serde(with = "serialize::vec"))]37	pub key: BoundedString,3839	/// Value of the property40	#[cfg_attr(feature = "std", serde(with = "serialize::vec"))]41	pub value: BoundedString,42}