public inbox for yew-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: yew-devel@lists.proxmox.com
Subject: [yew-devel] [PATCH yew-comp 1/1] rrd: replace TextRenderFn with new generic RenderFn
Date: Wed, 10 Dec 2025 11:48:51 +0100	[thread overview]
Message-ID: <20251210104856.1698157-5-d.csapak@proxmox.com> (raw)
In-Reply-To: <20251210104856.1698157-1-d.csapak@proxmox.com>

since RenderFn now has a generic return type, we can use that instead of
TextRenderFn.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/rrd/graph.rs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/rrd/graph.rs b/src/rrd/graph.rs
index 689164b..66871cb 100644
--- a/src/rrd/graph.rs
+++ b/src/rrd/graph.rs
@@ -9,7 +9,7 @@ use yew::virtual_dom::{VComp, VNode};
 use pwt::dom::align::{align_to, AlignOptions};
 use pwt::dom::DomSizeObserver;
 use pwt::prelude::*;
-use pwt::props::{IntoOptionalTextRenderFn, TextRenderFn};
+use pwt::props::{IntoOptionalRenderFn, RenderFn};
 use pwt::state::optional_rc_ptr_eq;
 use pwt::widget::{Button, Container, Panel};
 
@@ -52,7 +52,7 @@ pub struct RRDGraph {
     pub binary: bool,
 
     #[prop_or_default]
-    pub render_value: Option<TextRenderFn<f64>>,
+    pub render_value: Option<RenderFn<f64, String>>,
 }
 
 impl RRDGraph {
@@ -95,8 +95,8 @@ impl RRDGraph {
         self.class.push(class);
     }
 
-    pub fn render_value(mut self, renderer: impl IntoOptionalTextRenderFn<f64>) -> Self {
-        self.render_value = renderer.into_optional_text_render_fn();
+    pub fn render_value(mut self, renderer: impl IntoOptionalRenderFn<f64, String>) -> Self {
+        self.render_value = renderer.into_optional_render_fn();
         self
     }
 }
-- 
2.47.3



_______________________________________________
yew-devel mailing list
yew-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/yew-devel


  parent reply	other threads:[~2025-12-10 10:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-10 10:48 [yew-devel] [RFC yew-comp/yew-widget-toolkit 0/4] make RenderFn's return type generic Dominik Csapak
2025-12-10 10:48 ` [yew-devel] [PATCH yew-widget-toolkit 1/3] pwt-macros: update tests to work for newer rustc Dominik Csapak
2025-12-10 10:48 ` [yew-devel] [PATCH yew-widget-toolkit 2/3] pwt-macros: builder: allow multiple generic types in callback variant Dominik Csapak
2025-12-10 10:48 ` [yew-devel] [PATCH yew-widget-toolkit 3/3] props: make RenderFn's return type generic Dominik Csapak
2025-12-10 10:48 ` Dominik Csapak [this message]
2025-12-11  9:35 ` [yew-devel] applied: [RFC yew-comp/yew-widget-toolkit 0/4] " Dietmar Maurer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251210104856.1698157-5-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=yew-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal