Skip to content

Support #[scylla(transparent)] attribute by derive macros #1293

Open
@wprzytula

Description

@wprzytula

Motivation

Users seems to often employ the newtype pattern (i.e., define single-field structs) to wrap the driver's types that implement {De,S}erialize{Value,Row}. In such case, they are forced to manually implemenent (trivially) the respective de/ser traits for those new types.

Solution

Add support for a new item-level attribute, #[scylla(transparent)]:

  1. on single-field structs (the original use case),
  2. on single-variant enums (because why not; technically, it's the same).

The semantics is simple: delegate the trait method's implementation to the only field/variant of the struct/enum.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions