wrapper-lite 0.6.2

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

## v0.6.2

- Fixed: compatibility issue with `#[repr(align(cache))]` being used with `#[cfg]` attributes.

## v0.6.1

- Fixed: `#[wrapper(DisplayName)]` should not require the inner type to implement `Display`.

## v0.6.0

- Fixed: `#[wrapper(From)]` should not generate a const constructor method named `from`.

  You can use the generated `from_inner` method to construct the wrapper type from the inner type within a const context.

  ```rust
  mod test {
      wrapper_lite::wrapper!(
          #[wrapper(From)]
          pub struct Foobar<T>(pub T);
      );
  }

  assert_from::<test::Foobar<()>, ()>();

  let _ = test::Foobar::from_inner("Hello");
  ```

- Added: `#[wrapper(DisplayName)]` to generate a `Display` impl that simply outputs the name of the wrapper type.

  ```rust
  wrapper_lite::wrapper!(
      #[wrapper(DisplayName)]
      pub struct Foobar<T>(T);
  );

  assert_eq!(format!("{}", Foobar(())), "Foobar");
  ```

- Removed: deprecated syntax `#[wrapper_impl(...)]` and `#[gen(...)]`.

  Please use `#[wrapper(...)]` instead.

## v0.5.2

- Fix: struct level `#[cfg(...)]` attribute was not applied to the generated impl blocks.

- Fix: `gen` is a reserved keyword since Rust 2024 edition.

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

  Instead:

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

## 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 `#[wrapper(...)]`.

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

  Instead:

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

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

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

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

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

- `general_wrapper!` is essentially `wrapper!` with `#[wrapper(AsRef)]`, `#[wrapper(Borrow)]`, and `#[wrapper(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!(
      #[wrapper(AsRef)]
      #[wrapper(Borrow)]
      #[wrapper(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!(
      #[wrapper(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