Skip to content

Field Attributes #2

@Nukesor

Description

@Nukesor

For more control about which fields should be used by InterStruct or in which way they should be used, field attributes will be added.

The idea is to have serde-like configuration pattern. I.e.:

struct SomeStruct {
    #[inter_struct(rename="something_else", unchecked)]
    something: String,
}

For now several options are planned:

  • unchecked InterStruct does some naive type checking by simply comparing the two types tokens.
    If the user is sure that the types are identical, unchecked will disable all of InterStruct's type checking.
  • rename="OtherName" This allows to map a field to a differently named field on the target struct.
  • ignore InterStruct will completely ignore this field.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions