Skip to main content

impl_backend_builder

Macro impl_backend_builder 

Source
macro_rules! impl_backend_builder {
    ($backend:ty, $builder:ty) => { ... };
}
Expand description

Macro to implement the common new() and builder() pattern for backends.

§Example

impl_backend_builder!(MyBackend, MyBackendBuilder);
// Expands to:
// impl MyBackend {
//     pub fn new() -> Self { Self::builder().build() }
//     pub fn builder() -> MyBackendBuilder { MyBackendBuilder::default() }
// }