public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Wolfgang Bumiller <w.bumiller@proxmox.com>
To: "Max R. Carrara" <m.carrara@proxmox.com>
Cc: pve-devel@lists.proxmox.com
Subject: partially-applied: [PATCH perlmod 2/4] value: implement serde::de::IntoDeserializer on Value
Date: Thu, 23 Jul 2026 09:50:39 +0200	[thread overview]
Message-ID: <xfqe5dbbkrt7u5rqxlp5t5disps6e7jvqnnmbbt27xl4rpn5zq@kfmqkefpo2mf> (raw)
In-Reply-To: <3s5aifg3nyfpu4vavjjdeelhvqztbztz6yohiqckwzma5cfgcu@fgpi73fbpevp>

On Thu, Jul 23, 2026 at 09:34:51AM +0200, Wolfgang Bumiller wrote:
> On Mon, Jul 20, 2026 at 05:25:38PM +0200, Max R. Carrara wrote:
> > For better compatibility with serde, we implement
> > `serde::de::IntoDeserializer` on `Value`. This allows us to skip
> > explicitly converting to the `Value` deserializer in `perlmod::de`.
> > 
> > Signed-off-by: Max R. Carrara <m.carrara@proxmox.com>
> > ---
> >  perlmod-macro/src/function.rs | 2 +-
> >  perlmod/src/value.rs          | 9 +++++++++
> >  2 files changed, 10 insertions(+), 1 deletion(-)
> > 
> > diff --git a/perlmod-macro/src/function.rs b/perlmod-macro/src/function.rs
> > index 0a4cf0e..8b5d689 100644
> > --- a/perlmod-macro/src/function.rs
> > +++ b/perlmod-macro/src/function.rs
> > @@ -136,7 +136,7 @@ impl ArgumentAttrs {
> >                      let _guard = ::perlmod::__private__::InParameterDeserialization::guard();
> >                      match <#arg_type as ::perlmod::__private__::serde::Deserialize>::deserialize(
> >                          ::perlmod::__private__::serde::de::value::SeqDeserializer::new(
> > -                            #extracted_name.map(::perlmod::de::Deserializer::<'static>::from_value)
> > +                            #extracted_name
> >                          )
> >                      ) {
> >                          Ok(arg) => arg,
> > diff --git a/perlmod/src/value.rs b/perlmod/src/value.rs
> > index 1240eb5..5c2d432 100644
> > --- a/perlmod/src/value.rs
> > +++ b/perlmod/src/value.rs
> > @@ -3,6 +3,7 @@
> >  
> >  use std::fmt;
> >  
> > +use serde::de::IntoDeserializer;
> 
> For a single-use I'd rather skip the import.
> 
> That said, if we do this at all, one might wonder whether `&'de Value`
> should also be IntoDeserializer (via `de::from_ref_value`).

Applied this and patch 1 anyway now. Could add this later if we need it.




  reply	other threads:[~2026-07-23  7:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20 15:25 [PATCH perlmod 0/4] perlmod: add #[hash] parameter Max R. Carrara
2026-07-20 15:25 ` [PATCH perlmod 1/4] ffi: implement ExactSizeIterator for StackIter Max R. Carrara
2026-07-20 15:25 ` [PATCH perlmod 2/4] value: implement serde::de::IntoDeserializer on Value Max R. Carrara
2026-07-23  7:34   ` Wolfgang Bumiller
2026-07-23  7:50     ` Wolfgang Bumiller [this message]
2026-07-20 15:25 ` [PATCH perlmod 3/4] perlmod, macro: add #[hash] parameter Max R. Carrara
2026-07-23  7:54   ` Wolfgang Bumiller
2026-07-20 15:25 ` [PATCH perlmod 4/4] testlib: run perltidy Max R. Carrara
2026-07-23  7:55   ` partially-applied: " Wolfgang Bumiller

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=xfqe5dbbkrt7u5rqxlp5t5disps6e7jvqnnmbbt27xl4rpn5zq@kfmqkefpo2mf \
    --to=w.bumiller@proxmox.com \
    --cc=m.carrara@proxmox.com \
    --cc=pve-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