Skip to content

block2 0.2.0-alpha.6: Implementing Encode/RefEncode is bothersome and not always possible #16

@poliorcetics

Description

@poliorcetics

I tried using the alpha 6 of block2, which lead me to objc2_encode which asked me to implement Encode and RefEncode

  1. It is bothersome to implement for the default case (a struct/union) with no particular semantics, in which case a derive proc macro could be provided.
  2. When using types from libc, e.g. stat, I either have to stop and not implement the traits or I have to go deep to find if there are pointers/members to other structs where I have to do the same until I reach only base types. In the case of pointers I don't even know how I would do it ? A mimic struct defined locally which implements Encode ?

I don't know if there is a good solution to 2. sadly, because adding a dep in libc on objc2_encode is certainly not going to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions