#![no_implicit_prelude] // Shadow primitives #[allow(non_camel_case_types)] pub struct bool; #[allow(non_camel_case_types)] pub struct char; #[allow(non_camel_case_types)] pub struct f32; #[allow(non_camel_case_types)] pub struct f64; #[allow(non_camel_case_types)] pub struct i128; #[allow(non_camel_case_types)] pub struct i16; #[allow(non_camel_case_types)] pub struct i32; #[allow(non_camel_case_types)] pub struct i64; #[allow(non_camel_case_types)] pub struct i8; #[allow(non_camel_case_types)] pub struct isize; #[allow(non_camel_case_types)] pub struct str; #[allow(non_camel_case_types)] pub struct u128; #[allow(non_camel_case_types)] pub struct u16; #[allow(non_camel_case_types)] pub struct u32; #[allow(non_camel_case_types)] pub struct u64; #[allow(non_camel_case_types)] pub struct u8; #[allow(non_camel_case_types)] pub struct usize; #[derive( ::std::clone::Clone, ::yew::Properties, ::std::default::Default, ::std::cmp::PartialEq, )] pub struct ContainerProperties { pub int: ::std::primitive::i32, // You can use Html as Children. #[prop_or_default] pub children: ::yew::Html, #[prop_or_default] pub header: ::yew::Html, } pub struct Container; impl ::yew::Component for Container { type Message = (); type Properties = ContainerProperties; fn create(_ctx: &::yew::Context) -> Self { ::std::unimplemented!() } fn view(&self, _ctx: &::yew::Context) -> ::yew::Html { ::std::unimplemented!() } } #[derive(::std::clone::Clone, ::std::cmp::PartialEq)] pub enum ChildrenVariants { Child(::yew::virtual_dom::VChild), AltChild(::yew::virtual_dom::VChild), } impl ::std::convert::From<::yew::virtual_dom::VChild> for ChildrenVariants { fn from(comp: ::yew::virtual_dom::VChild) -> Self { ChildrenVariants::Child(comp) } } impl ::std::convert::From<::yew::virtual_dom::VChild> for ChildrenVariants { fn from(comp: ::yew::virtual_dom::VChild) -> Self { ChildrenVariants::AltChild(comp) } } impl ::std::convert::Into<::yew::virtual_dom::VNode> for ChildrenVariants { fn into(self) -> ::yew::virtual_dom::VNode { match self { Self::Child(comp) => ::yew::virtual_dom::VNode::VComp(::std::convert::Into::< ::yew::virtual_dom::VComp, >::into(comp)), Self::AltChild(comp) => ::yew::virtual_dom::VNode::VComp(::std::convert::Into::< ::yew::virtual_dom::VComp, >::into(comp)), } } } #[derive( ::std::clone::Clone, ::yew::Properties, ::std::default::Default, ::std::cmp::PartialEq, )] pub struct ChildProperties { #[prop_or_default] pub string: ::std::string::String, #[prop_or_default] pub r#fn: ::std::primitive::i32, #[prop_or_default] pub r#ref: ::yew::NodeRef, pub int: ::std::primitive::i32, #[prop_or_default] pub opt_str: ::std::option::Option<::std::string::String>, #[prop_or_default] pub vec: ::std::vec::Vec<::std::primitive::i32>, #[prop_or_default] pub optional_callback: ::std::option::Option<::yew::Callback<()>>, } pub struct Child; impl ::yew::Component for Child { type Message = (); type Properties = ChildProperties; fn create(_ctx: &::yew::Context) -> Self { ::std::unimplemented!() } fn view(&self, _ctx: &::yew::Context) -> ::yew::Html { ::std::unimplemented!() } } pub struct AltChild; impl ::yew::Component for AltChild { type Message = (); type Properties = (); fn create(_ctx: &::yew::Context) -> Self { ::std::unimplemented!() } fn view(&self, _ctx: &::yew::Context) -> ::yew::Html { ::std::unimplemented!() } } mod scoped { pub use super::{Child, Container}; } #[derive( ::std::clone::Clone, ::yew::Properties, ::std::default::Default, ::std::cmp::PartialEq, )] pub struct RenderPropProps { // You can use Callback<()> as Children. #[prop_or_default] pub children: ::yew::Callback<()>, } #[::yew::function_component] pub fn RenderPropComp(_props: &RenderPropProps) -> ::yew::Html { ::yew::html! {} } fn compile_pass() { ::yew::html! { }; ::yew::html! { }; ::yew::html! { <> }; let props = <::Properties as ::std::default::Default>::default(); let node_ref = <::yew::NodeRef as ::std::default::Default>::default(); ::yew::html! { <> ::Properties as ::std::default::Default>::default() /> ::Properties as ::std::default::Default>::default() /> }; ::yew::html! { <> >::from("child")} int=1 /> >::from("child")} int=1 /> >::from("child"))} int=1 /> }; let name_expr = "child"; ::yew::html! { }; let string = "child"; let int = 1; ::yew::html! { }; ::yew::html! { <> as ::std::convert::From<_>>::from(|_| ()))} /> as ::std::convert::From<_>>::from(|_| ())} /> >} /> }; let node_ref = <::yew::NodeRef as ::std::default::Default>::default(); ::yew::html! { <> }; let int = 1; let node_ref = <::yew::NodeRef as ::std::default::Default>::default(); ::yew::html! { <> }; let props = <::Properties as ::std::default::Default>::default(); let child_props = <::Properties as ::std::default::Default>::default(); ::yew::html! { <>
{ "hello world" }
{ "hello world" }
}} /> }; let variants = || -> ::std::vec::Vec { ::std::vec![ ChildrenVariants::Child(::yew::virtual_dom::VChild::new( ::default(), ::std::option::Option::None, )), ChildrenVariants::AltChild(::yew::virtual_dom::VChild::new( (), ::std::option::Option::None )), ] }; ::yew::html! { <> { ::std::iter::Iterator::collect::<::yew::virtual_dom::VNode>( ::std::iter::Iterator::filter( ::std::iter::IntoIterator::into_iter(variants()), |c| match c { ChildrenVariants::Child(_) => true, _ => false, } ) ) }
{ ::std::iter::Iterator::collect::<::yew::virtual_dom::VNode>( ::std::iter::Iterator::filter( ::std::iter::IntoIterator::into_iter(variants()), |c| match c { ChildrenVariants::AltChild(_) => true, _ => false, } ) ) }
}; ::yew::html_nested! { 1 }; ::yew::html! { {|_arg| {}} }; } fn main() {}