Home
last modified time | relevance | path

Searched refs:Any (Results 1 – 25 of 74) sorted by relevance

123

/DragonOS/kernel/crates/intertrait/src/
H A Dlib.rs66 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 Dcasting.rs19 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 Dcasting.md44 …现`DowncastArc`trait。这个trait定义在`kernel/src/libs/casting.rs`中。它要求`trait U`实现`Any + Sync + Send`trait.
46 &emsp;&emsp;为`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 Dunix.rs117 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 Dmod.rs1 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 Dinet.rs230 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 Dmod.rs9 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 Dmsi.rs1 use core::{any::Any, fmt::Debug};
135 pub trait MsiDescFuncData: Send + Sync + Any {}
H A Dirqchip.rs1 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 Dkobject.rs1 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 Dcpu.rs1 use core::any::Any;
205 fn as_any_ref(&self) -> &dyn Any { in as_any_ref() argument
/DragonOS/docs/kernel/filesystem/
H A Dsysfs.md29 pub trait Device: Any + Send + Sync + Debug {}
47 pub trait Driver: Any + Send + Sync + Debug {}
/DragonOS/kernel/src/bpf/prog/
H A Dmod.rs17 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 Dmod.rs1 use core::any::Any;
173 fn as_any(&self) -> &dyn Any { in as_any() argument
/DragonOS/kernel/src/perf/
H A Dkprobe.rs18 use core::any::Any;
110 fn as_any_ref(&self) -> &dyn Any { in as_any_ref() argument
H A Dmod.rs28 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 Dmod.rs4 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 Dmod.rs7 use core::any::Any;
188 fn as_any(&self) -> &dyn Any { in as_any() argument
/DragonOS/kernel/crates/intertrait/
H A DREADME.md12 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 Dpt_device.rs1 use core::any::Any;
170 fn as_any_ref(&self) -> &dyn Any { in as_any_ref() argument
/DragonOS/kernel/src/driver/pci/
H A Draw_device.rs1 use core::any::Any;
176 fn as_any_ref(&self) -> &dyn Any { in as_any_ref() argument
/DragonOS/kernel/src/filesystem/devpts/
H A Dmod.rs79 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 Deventfd.rs15 use core::any::Any;
242 fn as_any_ref(&self) -> &dyn Any { in as_any_ref() argument
/DragonOS/kernel/src/driver/block/
H A Dvirtio_blk.rs1 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 Dmod.rs23 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

123