mod api {
pub trait Printer {
fn new() -> Self;
fn print(&self);
}
}
mod library {
pub struct MyPrinter;
impl super::api::Printer for MyPrinter {
fn new() -> MyPrinter {
MyPrinter
}
fn print(&self) {
}
}
}
// library.h
class Interface {
private:
class Impl;
Impl* m_impl;
};
// library.cpp
class Interface::Impl {
};