摘要: use std::fmt::{Debug, Display}; use std::any::TypeId; use std::any::Any; fn is_string<T: ?Sized + Any>(_s: &T) -> bool { TypeId::of::<String>() == Typ 阅读全文
posted @ 2022-07-25 22:01 CrossPython 阅读(25) 评论(0) 推荐(0)
摘要: mopa = 0.2 use mopa; use std::fmt::Debug; use std::fmt::Display; use std::any::TypeId; fn is_string<T: ?Sized + mopa::Any>(_s: &T) -> bool { TypeId::o 阅读全文
posted @ 2022-07-25 18:38 CrossPython 阅读(19) 评论(0) 推荐(0)
摘要: #[macro_use] extern crate mopa; struct Bear { // This might be a pretty fat bear. fatness: u16, } impl Bear { fn eat(&mut self, person: Box<dyn Person 阅读全文
posted @ 2022-07-25 18:28 CrossPython 阅读(24) 评论(0) 推荐(0)