Registry / utility / delegate-attr

delegate-attr

JSON →
library0.3.0rscratesunverified

Attribute proc-macro to delegate method calls to a field.

# Cargo.toml [dependencies] delegate-attr = "0.3.0"
INSTALL
IMPORT
SIG · DELEGATE-ATTR
D
delegate-attr
utilityrustv0.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

delegate
✓ use delegate_attr::delegate;

Delegates the foo method from Inner to Outer using the delegate attribute.

use delegate_attr::delegate; struct Inner; impl Inner { fn foo(&self) -> &str { "hello" } } #[delegate(self.inner)] struct Outer { inner: Inner, } fn main() { let outer = Outer { inner: Inner }; assert_eq!(outer.foo(), "hello"); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.3.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
12
Resources
delegate-attr — cargo add delegate-attr · libregistry