mirror of
https://github.com/TECHNOFAB11/aerosol.git
synced 2025-12-13 00:20:08 +01:00
Cargo Format
This commit is contained in:
parent
2c5dadba8d
commit
808bc022f3
4 changed files with 60 additions and 59 deletions
|
|
@ -133,49 +133,49 @@ macro_rules! private_define_interface {
|
|||
/// Define a new interface. Used at any layer of your application
|
||||
/// to declare what dependencies are required by that part of the
|
||||
/// program.
|
||||
///
|
||||
///
|
||||
/// Interfaces follow a trait-like syntax, except that they may
|
||||
/// only contain "getter" methods of a particular form. The names
|
||||
/// of these methods are for the most part unimportant, but the
|
||||
/// return types are used to identify dependencies required for
|
||||
/// a context to implement this interface.
|
||||
///
|
||||
///
|
||||
/// ## Example
|
||||
///
|
||||
///
|
||||
/// ```
|
||||
/// use std::sync::Arc;
|
||||
///
|
||||
///
|
||||
/// #[derive(Debug)]
|
||||
/// struct Foo;
|
||||
///
|
||||
///
|
||||
/// aerosol::define_interface!(
|
||||
/// TestInterface {
|
||||
/// fn foo(&self) -> Arc<Foo>;
|
||||
/// }
|
||||
/// );
|
||||
/// ```
|
||||
///
|
||||
///
|
||||
/// Interfaces may also specify super-traits, which can themselves
|
||||
/// be interfaces. Interfaces do not need to explicitly list
|
||||
/// dependencies if they are transitively required by one of their
|
||||
/// super-traits, but repeating a dependency will still only
|
||||
/// require it to be provided once.
|
||||
///
|
||||
///
|
||||
/// ## Example
|
||||
///
|
||||
///
|
||||
/// ```
|
||||
/// #![recursion_limit="128"]
|
||||
/// use std::sync::Arc;
|
||||
///
|
||||
///
|
||||
/// #[derive(Debug)]
|
||||
/// struct Foo;
|
||||
///
|
||||
///
|
||||
/// aerosol::define_interface!(
|
||||
/// FooInterface {
|
||||
/// fn foo(&self) -> Arc<Foo>;
|
||||
/// }
|
||||
/// );
|
||||
///
|
||||
///
|
||||
/// aerosol::define_interface!(
|
||||
/// TestInterface: FooInterface + Clone {}
|
||||
/// );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue