💥 Oculta as_ref_any() y as_mut_any() en la API

This commit is contained in:
Manuel Cillero 2023-07-11 21:17:35 +02:00
parent 0880964fd1
commit 9a49186ed2
25 changed files with 41 additions and 196 deletions

View file

@ -84,14 +84,6 @@ impl ComponentTrait for Anchor {
}
})
}
fn as_ref_any(&self) -> &dyn AnyComponent {
self
}
fn as_mut_any(&mut self) -> &mut dyn AnyComponent {
self
}
}
impl Anchor {

View file

@ -58,14 +58,6 @@ impl ComponentTrait for Block {
fn after_prepare_component(&mut self, cx: &mut Context) {
run_actions_after_prepare_block(self, cx);
}
fn as_ref_any(&self) -> &dyn AnyComponent {
self
}
fn as_mut_any(&mut self) -> &mut dyn AnyComponent {
self
}
}
impl Block {

View file

@ -95,14 +95,6 @@ impl ComponentTrait for Container {
fn after_prepare_component(&mut self, cx: &mut Context) {
run_actions_after_prepare_container(self, cx);
}
fn as_ref_any(&self) -> &dyn AnyComponent {
self
}
fn as_mut_any(&mut self) -> &mut dyn AnyComponent {
self
}
}
impl Container {

View file

@ -67,14 +67,6 @@ impl ComponentTrait for Button {
}
})
}
fn as_ref_any(&self) -> &dyn AnyComponent {
self
}
fn as_mut_any(&mut self) -> &mut dyn AnyComponent {
self
}
}
impl Button {

View file

@ -72,14 +72,6 @@ impl ComponentTrait for Date {
}
})
}
fn as_ref_any(&self) -> &dyn AnyComponent {
self
}
fn as_mut_any(&mut self) -> &mut dyn AnyComponent {
self
}
}
impl Date {

View file

@ -73,14 +73,6 @@ impl ComponentTrait for Form {
fn after_prepare_component(&mut self, cx: &mut Context) {
run_actions_after_prepare_form(self, cx);
}
fn as_ref_any(&self) -> &dyn AnyComponent {
self
}
fn as_mut_any(&mut self) -> &mut dyn AnyComponent {
self
}
}
impl Form {

View file

@ -29,14 +29,6 @@ impl ComponentTrait for Hidden {
input type="hidden" id=[id] name=[self.name().get()] value=[self.value().get()];
})
}
fn as_ref_any(&self) -> &dyn AnyComponent {
self
}
fn as_mut_any(&mut self) -> &mut dyn AnyComponent {
self
}
}
impl Hidden {

View file

@ -106,14 +106,6 @@ impl ComponentTrait for Input {
}
})
}
fn as_ref_any(&self) -> &dyn AnyComponent {
self
}
fn as_mut_any(&mut self) -> &mut dyn AnyComponent {
self
}
}
impl Input {

View file

@ -84,14 +84,6 @@ impl ComponentTrait for Column {
fn after_prepare_component(&mut self, cx: &mut Context) {
run_actions_after_prepare_column(self, cx);
}
fn as_ref_any(&self) -> &dyn AnyComponent {
self
}
fn as_mut_any(&mut self) -> &mut dyn AnyComponent {
self
}
}
impl Column {

View file

@ -53,14 +53,6 @@ impl ComponentTrait for Row {
fn after_prepare_component(&mut self, cx: &mut Context) {
run_actions_after_prepare_row(self, cx);
}
fn as_ref_any(&self) -> &dyn AnyComponent {
self
}
fn as_mut_any(&mut self) -> &mut dyn AnyComponent {
self
}
}
impl Row {

View file

@ -73,14 +73,6 @@ impl ComponentTrait for Heading {
HeadingType::H6 => h6 id=[id] class=[classes] { (self.text().prepare(cx)) },
}})
}
fn as_ref_any(&self) -> &dyn AnyComponent {
self
}
fn as_mut_any(&mut self) -> &mut dyn AnyComponent {
self
}
}
impl Heading {

View file

@ -37,14 +37,6 @@ impl ComponentTrait for Icon {
fn prepare_component(&self, _: &mut Context) -> PrepareMarkup {
PrepareMarkup::With(html! { i class=[self.classes().get()] {}; })
}
fn as_ref_any(&self) -> &dyn AnyComponent {
self
}
fn as_mut_any(&mut self) -> &mut dyn AnyComponent {
self
}
}
impl Icon {

View file

@ -42,14 +42,6 @@ impl ComponentTrait for Image {
class=[self.classes().get()];
})
}
fn as_ref_any(&self) -> &dyn AnyComponent {
self
}
fn as_mut_any(&mut self) -> &mut dyn AnyComponent {
self
}
}
impl Image {

View file

@ -56,14 +56,6 @@ impl ComponentTrait for Paragraph {
}
})
}
fn as_ref_any(&self) -> &dyn AnyComponent {
self
}
fn as_mut_any(&mut self) -> &mut dyn AnyComponent {
self
}
}
impl Paragraph {