Skip to content

Revamp APIs and support `Rc` and `Arc`

Compare
Choose a tag to compare
@dynaxis dynaxis released this 24 Apr 15:57
· 20 commits to master since this release

This release is incompatible with the previous 0.1.x ones, and completely revamped the APIs for beter ergonomics. The highlights are:

  • Support Rc and Arc
    • For Arc, the underlying type must be Sync + Send, use CastFromSync instead of CastFrom and add [sync] flag right before the list of traits in macros
  • All casts use methods with the same name, cast (that is, cast is an overloaded name)
    • Separate traits are defined for each receiver type requireing casts
  • Casts for Box, Rc, and Arc return Result instead of Option to give the original receiver back on failure
    • This was the original design and returning Option was a bug in API design