docs.rs failed to build toga-1.0.2
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
toga-1.0.8
toga-blockset
Toga is a proc macro crate for cleaner and more ergonomic rust.
Features
- Single-Block Syntax: Define inherent methods and multiple trait implementations for a type within one macro invocation.
- Generics & Where Clauses: Preserve type and trait generics, as well as
whereconstraints, across all generatedimpls. - Flexible Trait Paths: Support for absolute, relative, and
self::-qualified trait paths. - Reduced Boilerplate: Eliminate repetitive
impldeclarations and unify method and trait definitions.
Installation
Add the crate to your Cargo.toml:
[]
= "*"
Then import the macro in your crate:
use impls;
Usage
// Define some traits
// A generic struct with a const parameter
;
// Use the `impls!` macro to generate implementations
impls!
Macro Syntax
impls! {
impl<ImplGenerics> Type<TypeGenerics>
where
...;
// Inherent methods
fn method1(...) { ... }
// Trait blocks
path::ToTrait<TraitGenerics> {
fn trait_method(...) -> ... { ... }
}
}
- Header: Starts with
impl, optional generics, andwhereclause. - Inherent Methods: Any
fndeclarations before trait blocks. - Trait Blocks: Blocks prefixed by a trait path are parsed as trait implementations.
License
Apache-2.0