+#![allow(unused_imports)]
+
use educe::Educe;
use std::fmt::{self, Debug};
+trait Object {}
+trait ClientSideDb {}
+
+use std::sync::Arc;
+use Arc as DbPtr;
+use Arc as ClientDb;
+
+impl Object for NotDebug {}
+impl ClientSideDb for NotDebug {}
+
#[derive(Educe)]
-#[educe(Debug(bound = "X: Debug"))]
-pub struct Thing<X> {
- #[educe(Debug(method = "no_fmt"))]
- field: Box<X>,
-}
+//#[educe(Clone, Debug(bound(T: Debug)))]
+#[educe(Clone(bound()), Debug)]
+pub struct Obj<T: Object, LocalDb: ClientSideDb> {
+ ptr: DbPtr<T>,
+ data: Arc<T>,
-fn no_fmt<Q>(_: &Q, _f: &mut fmt::Formatter) -> fmt::Result {
- Ok(())
+ #[educe(Debug(ignore))]
+ db: Arc<ClientDb<LocalDb>>,
}
+#[derive(Clone)]
+struct NotDebug;
+
fn main() {
- let a = Thing {
- field: Box::new(42),
+ let a = Obj {
+ ptr: Arc::new(NotDebug),
+ data: Arc::new(NotDebug),
+ db: Arc::new(Arc::new(NotDebug)),
};
- println!("{:?}", &a);
+ let a = a.clone();
+// println!("{:?}", &a);
}