Skip to content

How to handle size of items defined in third party crates? #2

@little-dude

Description

@little-dude

Hi,

This crate relies on SizeOf being implemented for the types we're interested in. There are two issues with this:

  • users of size-of can't implement this trait directly for types that are defined in dependencies. The only solution that comes to mind is to create wrappers for these types and implement size-of for these wrappers.
  • even then, implementing SizeOf requires looking at the target type layout. The problem is that many crates don't expose the internals of the types they expose, and because these details are not part of the public API, they can change with any version bump, making our SizeOf impls inaccurate.

Do you have plans/ideas/recommendations to mitigate these issues?

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