pub struct DynamicXmlComponent {
pub name: String,
pub arguments: ComponentArguments,
pub root: XmlNode,
}Expand description
Component that was created from a XML node (instead of being registered from Rust code). Necessary to
Fields§
§name: StringWhat the name of this component is, i.e. “test” for <component name="test" />
arguments: ComponentArgumentsWhether this component has any args="a: String" arguments
root: XmlNodeRoot XML node of this component (the <component /> Node)
Implementations§
Source§impl DynamicXmlComponent
impl DynamicXmlComponent
Sourcepub fn new(root: XmlNode) -> Result<Self, ComponentParseError>
pub fn new(root: XmlNode) -> Result<Self, ComponentParseError>
Parses a component from an XML node
Trait Implementations§
Source§impl XmlComponent for DynamicXmlComponent
impl XmlComponent for DynamicXmlComponent
Source§fn get_available_arguments(&self) -> ComponentArguments
fn get_available_arguments(&self) -> ComponentArguments
Should return all arguments that this component can take - for example if you have a
component called
Calendar, which can take a selectedDate argument: Read moreSource§fn get_xml_node(&self) -> XmlNode
fn get_xml_node(&self) -> XmlNode
Returns the XML node for this component (necessary to compile the component into a function
during the Rust compilation stage)
Source§fn render_dom(
&self,
components: &XmlComponentMap,
arguments: &FilteredComponentArguments,
content: &XmlTextContent,
) -> Result<Dom, RenderDomError>
fn render_dom( &self, components: &XmlComponentMap, arguments: &FilteredComponentArguments, content: &XmlTextContent, ) -> Result<Dom, RenderDomError>
Given a root node and a list of possible arguments, returns a DOM or a syntax error
Source§fn compile_to_rust_code(
&self,
components: &XmlComponentMap,
attributes: &FilteredComponentArguments,
content: &XmlTextContent,
) -> Result<String, CompileError>
fn compile_to_rust_code( &self, components: &XmlComponentMap, attributes: &FilteredComponentArguments, content: &XmlTextContent, ) -> Result<String, CompileError>
Used to compile the XML component to Rust code - input
Auto Trait Implementations§
impl Freeze for DynamicXmlComponent
impl RefUnwindSafe for DynamicXmlComponent
impl Send for DynamicXmlComponent
impl Sync for DynamicXmlComponent
impl Unpin for DynamicXmlComponent
impl UnsafeUnpin for DynamicXmlComponent
impl UnwindSafe for DynamicXmlComponent
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