[][src]Trait kompact::component::DynamicPortAccess

pub trait DynamicPortAccess {
    fn get_provided_port_as_any(
        &mut self,
        port_id: TypeId
    ) -> Option<&mut dyn Any>;
fn get_required_port_as_any(
        &mut self,
        port_id: TypeId
    ) -> Option<&mut dyn Any>; }

A mechanism for dynamically getting references to provided/required ports from a component.

Should only be used if working with concrete types, or strict generic bounds (i.e. Provide, ProvideRef, etc.) is not an option. This is the case, for example, when working with Arc<dyn AbstractComponent>.

Required methods

fn get_provided_port_as_any(&mut self, port_id: TypeId) -> Option<&mut dyn Any>

Internal API. Dynamically obtain a mutable reference to a ProvidedPort if self provides a port of the type indicated by the passed port_id.

This is a low-level API that is automatically implemented by #[derive(ComponentDefinition)]. Prefer the more strongly typed get_provided_port.

fn get_required_port_as_any(&mut self, port_id: TypeId) -> Option<&mut dyn Any>

Internal API. Dynamically obtain a mutable reference to a RequiredPort if self requires a port of the type indicated by the passed port_id.

This is a low-level API that is automatically implemented by #[derive(ComponentDefinition)]. Prefer the more strongly typed get_required_port.

Loading content...

Implementors

impl DynamicPortAccess for DeadletterBox[src]

impl DynamicPortAccess for LocalDispatcher[src]

impl DynamicPortAccess for TestComponent1[src]

impl DynamicPortAccess for TestComponent2[src]

impl DynamicPortAccess for BigPingerAct[src]

impl DynamicPortAccess for BigPongerAct[src]

impl DynamicPortAccess for ForwarderAct[src]

impl DynamicPortAccess for PingerAct[src]

impl DynamicPortAccess for PongerAct[src]

impl DynamicPortAccess for NetworkDispatcher[src]

Loading content...