inherits

Crates.ioinherits
lib.rsinherits
version0.1.2
created_at2025-03-07 11:58:16.14687+00
updated_at2025-03-28 01:00:41.120055+00
descriptionImproved Practices for the Composition Pattern in Rust
homepage
repositoryhttps://github.com/Anglebase/inherit.git
max_upload_size
id1582823
size7,527
(Anglebase)

documentation

README

[inherits(Type)]

This attribute macro achieves inheritance-like effects through the Deref and DerefMut traits, simplifying the application of the composition pattern in Rust.

A struct annotated with #[inherit(T)] will implicitly contain a parent field of type T, enabling single inheritance behavior.

For disambiguated access to fields with the same name, use (&<name> as &<type>).<field> or (&mut <name> as &mut <type>).<field> syntax.

[new_type]

This property macro can automatically implement the 'Deref' and 'DerefMut' traits for tuple structs to implement the New-Type pattern

Commit count: 0

cargo fmt