wrapper-lite 0.5.0

Helper macro for building a wrapper type and implementing common traits for it.
Documentation
# CHANGELOG

## latest

## v0.5.0

Due to the thorough refactoring we performed in this version, the changes listed here may not be complete.

- `#[wrapper_impl(...)]` is now deprecated in favor of `#[gen(...)]`.

  ```rust
  wrapper_lite::general_wrapper!(
      #[wrapper_impl(...)]
      pub struct Foobar<T>(T);
  );
  ```

  Instead:

  ```rust
  wrapper_lite::general_wrapper!(
      #[gen(...)]
      pub struct Foobar<T>(T);
  );
  ```

- `#[gen(ConstAsMut)]` (`#[wrapper_impl(ConstAsMut)]`) is now removed.

  ```rust
  wrapper_lite::general_wrapper!(
      #[wrapper_impl(ConstAsMut)]
      pub struct Foobar<T>(T);
  );
  ```

  Instead, use `#[gen([const] AsMut)]`:

  ```rust
  wrapper_lite::general_wrapper!(
      #[gen([const] AsMut)]
      pub struct Foobar<T>(T);
  );
  ```

- `general_wrapper!` is essentially `wrapper!` with `#[gen(AsRef)]`, `#[gen(Borrow)]`, and `#[gen(From)]`. To avoid unnecessary confusion (requiring users to check the documentation to know which traits are implemented), it's now deprecated.

  ```rust
  wrapper_lite::general_wrapper!(
      pub struct Foobar<T>(T);
  );
  ```

  Instead:

  ```rust
  wrapper_lite::wrapper!(
      #[gen(AsRef)]
      #[gen(Borrow)]
      #[gen(From)]
      pub struct Foobar<T>(T);
  );
  ```

- Syntax for specifying the default values for the other fields is now changed.

  ```rust
  wrapper_lite::wrapper!(
      #[wrapper_impl(From)]
      pub struct Foobar<T> {
          inner: T,
          _marker: ::core::marker::PhantomData<()> = ::core::marker::PhantomData,
      }
  );
  ```

  Instead:

  ```rust
  wrapper_lite::wrapper!(
      #[gen(From)]
      pub struct TestWrapperComplex<T> {
          inner: T,
          #[default(::core::marker::PhantomData)]
          _marker: ::core::marker::PhantomData<()>,
      }
  );
  ```

  This makes `rustfmt` happy and improves readability.

- A new attribute `#[bound(...)]` is added, which fixes some edge cases. Please check the docs for details.

## v0.4.0

- The generated method `const_from` is renamed to `from_inner` for better readability.
- Fix HRTB and default generic type handling, see the docs for details.
- No longer add `#[repr(transparent)]` attribute by default.

## v0.3.2

None

## v0.3.1

- For brace struct, the inner field name is no longer required to be `inner`. The first field will be treated as the inner field.

  ```rust
  wrapper_lite::wrapper!(
      #[wrapper_impl(AsRef<str>)]
      pub struct TestWrapperComplex {
          value: String, // <-- can be any name now, not necessarily "inner"
          _marker: ::core::marker::PhantomData<()>,
      }
  );
  ```

- The `#[repr(align(cache))]` attribute is introduced, please check the docs for details.

  ```rust
  wrapper_lite::wrapper!(
      #[repr(align(cache))]
      pub struct AlignedWrapper(u8);
  );
  ```

## v0.3.0

- When there's no default value specified, we cannot implement the `From` trait for the wrapper type, and it's now a hard error.

  ```rust,compile_fail
  wrapper_lite::wrapper!(
      #[wrapper_impl(From)]
      pub struct TestWrapperComplex<'a, 'b> {
          inner: String,
          _a: ::core::marker::PhantomData<&'a ()>,
          _b: ::core::marker::PhantomData<&'b ()>,
      }
  );
  ```

## v0.2.0

- The following syntax is no longer accepted:

  ```rust,compile_fail
  wrapper_lite::wrapper!(
      pub ExampleWrapper(u8)
  );
  ```

  Instead, please use standard Rust struct syntax:

  ```rust
  wrapper_lite::wrapper!(
      pub struct ExampleWrapper(u8);
  );
  ```

## v0.1.1

None

## v0.1.0

None