pub struct SerializedInterfaceDeclaration<ConfigType> { /* private fields */ }Expand description
Append-only builder for a serialized UI declaration instruction stream.
Use the builder methods to record operations in the same order they occur during live UI
construction. The resulting stream can be serialized to JSON via
LeafedInterfaceDeclaration::store_in.
§Examples
ⓘ
let mut decl = SerializedInterfaceDeclaration::<MyConfig>::new();
decl.start();
decl.open();
decl.add_config(my_config);
decl.close();
decl.end();Implementations§
Source§impl<Config> SerializedInterfaceDeclaration<Config>
impl<Config> SerializedInterfaceDeclaration<Config>
Sourcepub fn add_config(&mut self, config: Config)
pub fn add_config(&mut self, config: Config)
Records a Configure instruction.
Sourcepub fn add_leaf_config<LeafConfig: Serialize>(&mut self, config: &LeafConfig)
pub fn add_leaf_config<LeafConfig: Serialize>(&mut self, config: &LeafConfig)
Records a LeafConfig instruction.
Sourcepub fn iter_over(
&self,
) -> impl Iterator<Item = &SerializableInterfaceInstructions<Config>>
pub fn iter_over( &self, ) -> impl Iterator<Item = &SerializableInterfaceInstructions<Config>>
Iterates over the recorded instructions in order.
Trait Implementations§
Source§impl<ConfigType: Debug> Debug for SerializedInterfaceDeclaration<ConfigType>
impl<ConfigType: Debug> Debug for SerializedInterfaceDeclaration<ConfigType>
Source§impl<Config> Default for SerializedInterfaceDeclaration<Config>
impl<Config> Default for SerializedInterfaceDeclaration<Config>
Source§impl<'de, ConfigType> Deserialize<'de> for SerializedInterfaceDeclaration<ConfigType>where
ConfigType: Deserialize<'de>,
impl<'de, ConfigType> Deserialize<'de> for SerializedInterfaceDeclaration<ConfigType>where
ConfigType: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<ConfigType> Freeze for SerializedInterfaceDeclaration<ConfigType>
impl<ConfigType> RefUnwindSafe for SerializedInterfaceDeclaration<ConfigType>where
ConfigType: RefUnwindSafe,
impl<ConfigType> Send for SerializedInterfaceDeclaration<ConfigType>where
ConfigType: Send,
impl<ConfigType> Sync for SerializedInterfaceDeclaration<ConfigType>where
ConfigType: Sync,
impl<ConfigType> Unpin for SerializedInterfaceDeclaration<ConfigType>where
ConfigType: Unpin,
impl<ConfigType> UnsafeUnpin for SerializedInterfaceDeclaration<ConfigType>
impl<ConfigType> UnwindSafe for SerializedInterfaceDeclaration<ConfigType>where
ConfigType: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more