/DragonOS/kernel/crates/intertrait/src/ |
H A D | lib.rs | 66 any::{Any, TypeId}, 85 pub type BoxedCaster = Box<dyn Any + Send + Sync>; 167 fn cast_arc_panic<T: ?Sized + 'static>(_: Arc<dyn Any + Sync + Send>) -> Arc<T> { in cast_arc_panic() 181 pub cast_ref: fn(from: &dyn Any) -> &T, 185 pub cast_mut: fn(from: &mut dyn Any) -> &mut T, 189 pub cast_box: fn(from: Box<dyn Any>) -> Box<T>, 193 pub cast_rc: fn(from: Rc<dyn Any>) -> Rc<T>, 197 pub cast_arc: fn(from: Arc<dyn Any + Sync + Send + 'static>) -> Arc<T>, 202 cast_ref: fn(from: &dyn Any) -> &T, in new() 203 cast_mut: fn(from: &mut dyn Any) -> &mut T, in new() [all …]
|
/DragonOS/kernel/src/libs/ |
H A D | casting.rs | 19 use core::any::Any; 55 pub trait DowncastArc: Any + Send + Sync { 57 fn as_any_arc(self: Arc<Self>) -> Arc<dyn Any>; in as_any_arc() argument 64 fn downcast_arc<T: Any + Send + Sync>(self: Arc<Self>) -> Option<Arc<T>> { in downcast_arc() 65 let x: Arc<dyn Any> = self.as_any_arc(); in downcast_arc()
|
/DragonOS/docs/kernel/core_api/ |
H A D | casting.md | 44 …现`DowncastArc`trait。这个trait定义在`kernel/src/libs/casting.rs`中。它要求`trait U`实现`Any + Sync + Send`trait. 46   为`trait U: Any + Send + Sync`实现`DowncastArc`trait,需要这样做: 50 fn as_any_arc(self: Arc<Self>) -> Arc<dyn Any> {
|
/DragonOS/kernel/src/net/socket/ |
H A D | unix.rs | 117 fn as_any_ref(&self) -> &dyn core::any::Any { in as_any_ref() argument 121 fn as_any_mut(&mut self) -> &mut dyn core::any::Any { in as_any_mut() argument 232 fn as_any_ref(&self) -> &dyn core::any::Any { in as_any_ref() argument 236 fn as_any_mut(&mut self) -> &mut dyn core::any::Any { in as_any_mut() argument
|
H A D | mod.rs | 1 use core::{any::Any, fmt::Debug, sync::atomic::AtomicUsize}; 97 pub trait Socket: Sync + Send + Debug + Any { 241 fn as_any_ref(&self) -> &dyn Any; in as_any_ref() argument 243 fn as_any_mut(&mut self) -> &mut dyn Any; in as_any_mut() argument 381 fn as_any_ref(&self) -> &dyn Any { in as_any_ref() argument
|
H A D | inet.rs | 230 fn as_any_ref(&self) -> &dyn core::any::Any { in as_any_ref() argument 234 fn as_any_mut(&mut self) -> &mut dyn core::any::Any { in as_any_mut() argument 477 fn as_any_ref(&self) -> &dyn core::any::Any { in as_any_ref() argument 481 fn as_any_mut(&mut self) -> &mut dyn core::any::Any { in as_any_mut() argument 1005 fn as_any_ref(&self) -> &dyn core::any::Any { in as_any_ref() argument 1009 fn as_any_mut(&mut self) -> &mut dyn core::any::Any { in as_any_mut() argument
|
/DragonOS/kernel/src/filesystem/vfs/ |
H A D | mod.rs | 9 use ::core::{any::Any, fmt::Debug, sync::atomic::AtomicUsize}; 127 pub trait IndexNode: Any + Sync + Send + Debug + CastFromSync { 375 fn as_any_ref(&self) -> &dyn Any; in as_any_ref() argument 579 fn as_any_arc(self: Arc<Self>) -> Arc<dyn Any> { in as_any_arc() argument 845 pub trait FileSystem: Any + Sync + Send + Debug { 854 fn as_any_ref(&self) -> &dyn Any; in as_any_ref() argument 881 fn as_any_arc(self: Arc<Self>) -> Arc<dyn Any> { in as_any_arc() argument 947 fn as_any(&self) -> &dyn Any; in as_any() argument
|
/DragonOS/kernel/src/exception/ |
H A D | msi.rs | 1 use core::{any::Any, fmt::Debug}; 135 pub trait MsiDescFuncData: Send + Sync + Any {}
|
H A D | irqchip.rs | 1 use core::{any::Any, fmt::Debug, intrinsics::unlikely}; 39 pub trait IrqChip: Sync + Send + Any + Debug { 231 pub trait IrqChipData: Sync + Send + Any + Debug { 232 fn as_any_ref(&self) -> &dyn Any; in as_any_ref() argument 304 pub trait IrqChipGenericPrivateData: Sync + Send + Any + Debug {}
|
/DragonOS/kernel/src/driver/base/ |
H A D | kobject.rs | 1 use core::{any::Any, fmt::Debug, hash::Hash, ops::Deref}; 26 pub trait KObject: Any + Send + Sync + Debug + CastFromSync { 27 fn as_any_ref(&self) -> &dyn core::any::Any; in as_any_ref() argument 72 fn as_any_arc(self: Arc<Self>) -> Arc<dyn Any> { in as_any_arc() argument
|
H A D | cpu.rs | 1 use core::any::Any; 205 fn as_any_ref(&self) -> &dyn Any { in as_any_ref() argument
|
/DragonOS/docs/kernel/filesystem/ |
H A D | sysfs.md | 29 pub trait Device: Any + Send + Sync + Debug {} 47 pub trait Driver: Any + Send + Sync + Debug {}
|
/DragonOS/kernel/src/bpf/prog/ |
H A D | mod.rs | 17 use core::any::Any; 91 fn as_any_ref(&self) -> &dyn Any { in as_any_ref() argument
|
/DragonOS/kernel/src/arch/riscv64/interrupt/ |
H A D | mod.rs | 1 use core::any::Any; 173 fn as_any(&self) -> &dyn Any { in as_any() argument
|
/DragonOS/kernel/src/perf/ |
H A D | kprobe.rs | 18 use core::any::Any; 110 fn as_any_ref(&self) -> &dyn Any { in as_any_ref() argument
|
H A D | mod.rs | 28 use core::any::Any; 196 fn as_any_ref(&self) -> &dyn Any { in as_any_ref() argument 219 fn as_any_ref(&self) -> &dyn Any { in as_any_ref() argument
|
/DragonOS/kernel/crates/kprobe/src/arch/ |
H A D | mod.rs | 4 use core::{any::Any, fmt::Debug}; 29 fn as_any(&self) -> &dyn Any; in as_any() argument
|
/DragonOS/kernel/src/arch/x86_64/interrupt/ |
H A D | mod.rs | 7 use core::any::Any; 188 fn as_any(&self) -> &dyn Any { in as_any() argument
|
/DragonOS/kernel/crates/intertrait/ |
H A D | README.md | 12 In Rust, a trait object for a sub-trait of [`std::any::Any`] can be downcast to a concrete type at … 122 `std::sync::Arc` is unique in that it implements `downcast` method only on `dyn Any + Send + Sync +… 134 First of all, [`CastFrom`] trait makes it possible to retrieve an object of [`std::any::Any`] 138 for [`std::any::Any`] back to its concrete type and then creating a trait object for the target tra…
|
/DragonOS/kernel/src/driver/pci/test/ |
H A D | pt_device.rs | 1 use core::any::Any; 170 fn as_any_ref(&self) -> &dyn Any { in as_any_ref() argument
|
/DragonOS/kernel/src/driver/pci/ |
H A D | raw_device.rs | 1 use core::any::Any; 176 fn as_any_ref(&self) -> &dyn Any { in as_any_ref() argument
|
/DragonOS/kernel/src/filesystem/devpts/ |
H A D | mod.rs | 79 fn as_any_ref(&self) -> &dyn core::any::Any { in as_any_ref() argument 190 fn as_any_ref(&self) -> &dyn core::any::Any { in as_any_ref() argument
|
/DragonOS/kernel/src/filesystem/ |
H A D | eventfd.rs | 15 use core::any::Any; 242 fn as_any_ref(&self) -> &dyn Any { in as_any_ref() argument
|
/DragonOS/kernel/src/driver/block/ |
H A D | virtio_blk.rs | 1 use core::{any::Any, fmt::Debug}; 270 fn as_any_ref(&self) -> &dyn Any { in as_any_ref() argument 420 fn as_any_ref(&self) -> &dyn Any { in as_any_ref() argument 607 fn as_any_ref(&self) -> &dyn Any { in as_any_ref() argument
|
/DragonOS/kernel/src/bpf/map/ |
H A D | mod.rs | 23 use core::any::Any; 108 fn as_any_arc(self: Arc<Self>) -> Arc<dyn Any> { in as_any_arc() argument 178 fn as_any_ref(&self) -> &dyn Any { in as_any_ref() argument
|