- Now automatically-generated codes uses correct
Result
type (46ba3eb4defa).- This is a bugfix.
- Not
Result
(which can be local type), butstd::result::Result
. - Now it uses
std::...
path,opaque_typedef
crate supports only Rust 2018.
- Now
Self
is available for shortened notation instead ofSelf_
(44604fa9d6d954ba0b45f20aea9fd84133507a2a).- Users can use
Foo(Self)
instead ofFoo(Self_)
. Self_
will removed in future (but not now).
- Users can use
0.0.4 - 2018-05-30
- Resolve clippy lints (v0.0.206).
- Bump dependencies.
- Now
opaque_typedef_macro
uses syn-0.14 and quote-0.6.
- Now
0.0.3 - 2018-04-28
Many operators are now supported!
std::ops::*
traits (for operators) support (#7).- The targets below are added:
- Arithmetic unary:
Neg{,Ref}
- Arithmetic binary:
{Add,Div,Mul,Rem,Sub}{,Assign}{,Ref}{Self,Inner,InnerRev}
- Bitwise binary:
{BitAnd,BitOr,BitXor,Shl,Shr}{,Assign}{,Ref}{Self,Inner,InnerRev}
- Logical unary:
Not{,Ref}
- Arithmetic unary:
- The targets below are added:
0.0.2 - 2018-04-10
opaque_typedef_macros
is (almost) completely rewritten!- Many errors in README document are fixed.
- Custom comparator, validator, and generics are supported! 🎉
- Add shortened notations for
As{Mut,Ref}*
,Into*
:As{Mut,Ref}(*)
,Into(*)
(#3).- Note that
FooSelf
is shortened intoFoo(Self_)
, becauseSelf
is reserved keyword and cannot be used here.
- Note that
- Accept custom comparator function 🎉
(#4).
- Note that
opaque_typedef_macros
users are responsible to keep comparators behaviors consistent.
- Note that
- Add derive targets
Partial{Eq,Ord}Self
andOrd
(#4).- These are
#[derive({PartialEq, PartialOrd, Ord})]
with custom comparators.
- These are
- Accept validator function 🎉 (#5).
- Generics support 🎉 (#8).
- Add trait methods
OpaqueTypedef::try_from_inner
andOpaqueTypedefUnsized::try_from_inner{,_mut}
(dbd73af). - Change return types of trait methods
(dbd73af).
OpaqueTypedef::from_inner
now returnsSelf
, notResult<Self, Self::Error>
.OpaqueTypedefUnsized::try_from_inner{,_mut}
now returns&{,mut }Self
, notResult<&{,mut }Self, Self::Error>
.
- Add
std::fmt::Debug
trait bound toOpaqueTypedef{,Unsized}::Error
type. (dbd73af).- Usual error types (typically implements
std::error::Error
implementstd::fmt::Debug
andstd::fmt::Display
, so you may not be affected in most cases.
- Usual error types (typically implements
- Bump dependencies.
- Use
quote ^0.5
andsyn ^0.13.1
crates. They had breaking changes (fromquote ^0.3
andsyn ^0.11
), and it is whyopaque_typedef_macros
is totally rewritten (5bf3c37). - Use
strum ^0.9
.
- Use
- Require opaque typedef of unsized types to be
#[repr(C)]
or#[repr(transparent)]
(#1). #[opaque_typedef(deref(deref{,mut} = ..))]
now don't require#[opaque_typedef(deref(target = ..))]
.- If omitted, the inner type is used as deref target.
0.0.1 - 2017-12-06
Initial release.
OpaqueTypedef{,Unsized}
traits and#[derive(OpaqueTypedef{,Unsized})]
custom derive.- Many derive targets. See https://github.com/lo48576/opaque_typedef/blob/aafe5da5d0eb686cae0a5c5425ff91bbccaa8de4/README.md#automatic-derive-for-many-std-traits for detail.