all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH perlmod 0/4] perlmod: add #[hash] parameter
@ 2026-07-20 15:25 Max R. Carrara
  2026-07-20 15:25 ` [PATCH perlmod 1/4] ffi: implement ExactSizeIterator for StackIter Max R. Carrara
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Max R. Carrara @ 2026-07-20 15:25 UTC (permalink / raw)
  To: pve-devel

perlmod: add #[hash] parameter - v1
===================================

This series implements a `#[hash]` parameter similar to the existing
`#[list]` one, allowing us to create APIs like
`foo("arg", key => "value")` directly from Rust.

In other words, this essentially mirrors how a sub with `%params` as its
last parameter would work.

For example, this is one of the functions called by the tests that are
added in this series:

    #[export]
    fn trailing_hash(first: u32, #[hash] rest: HashMap<u32, u32>) -> String {
        format!("first={first}, rest is {rest:?}")
    }

This can then be called e.g. like this:

    let $res = TestLib::Hello::trailing_hash(42, 1337 => 123);

Summary of Changes
------------------


perlmod:

Max R. Carrara (4):
  ffi: implement ExactSizeIterator for StackIter
  value: implement serde::de::IntoDeserializer on Value
  perlmod, macro: add #[hash] parameter
  testlib: run perltidy

 perlmod-macro/src/function.rs | 72 ++++++++++++++++++++++++++++++++---
 perlmod/src/de.rs             | 44 +++++++++++++++++++++
 perlmod/src/ffi.rs            |  7 ++++
 perlmod/src/lib.rs            |  5 +++
 perlmod/src/value.rs          |  9 +++++
 testlib-tests/01-hello.t      | 70 +++++++++++++++++++++++++++++++---
 testlib/src/lib.rs            | 24 +++++++++++-
 7 files changed, 220 insertions(+), 11 deletions(-)


Summary over all repositories:
  7 files changed, 220 insertions(+), 11 deletions(-)

-- 
Generated by murpp 0.11.0




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-07-20 15:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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-20 15:25 ` [PATCH perlmod 3/4] perlmod, macro: add #[hash] parameter Max R. Carrara
2026-07-20 15:25 ` [PATCH perlmod 4/4] testlib: run perltidy Max R. Carrara

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal