摘要:
use std::any::Any; use core::fmt::Debug; trait ColTrait: std::fmt::Debug{ fn getself<T>(&self)->T; } #[derive(Debug)] struct DataCell<T>{ val:T, } // 阅读全文
摘要:
use std::{any::{Any, TypeId}, fmt::Debug}; use downcast_rs::Downcast; fn is_string<T: ?Sized + Any>(_s: &T) -> bool { TypeId::of::<String>() == TypeId 阅读全文