pub trait PortOwner {
// Required methods
fn owner_port_slot(&self, name: &str) -> Option<Rc<dyn Any>>;
fn owner_label(&self) -> &'static str;
}Expand description
Whatever connect is pointed at: a child slot, or a component itself.
This is the uniformity the UVM gets from uvm_test being a
uvm_component. &self.producer (an erased RustdvComp) and self (a
concrete component) are both &dyn PortOwner, so one connect serves both
and there is no special case for “my own port”.
Required Methods§
Sourcefn owner_port_slot(&self, name: &str) -> Option<Rc<dyn Any>>
fn owner_port_slot(&self, name: &str) -> Option<Rc<dyn Any>>
The binding cell of the named port, erased.
Sourcefn owner_label(&self) -> &'static str
fn owner_label(&self) -> &'static str
The component’s type name, for connection errors.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl PortOwner for RustdvComp
A slot is a PortOwner, so connect(&self.producer, ..) works on an
erased child exactly as connect(self, ..) works on the connecting
component. Both questions are answered by a ComponentNode method, which
is reachable through dyn — no cast to the child’s concrete type, which
Rust would not allow anyway.