Struct INodeComponentBase

pub struct INodeComponentBase(/* private fields */);

Implementations§

§

impl INodeComponentBase

pub fn attach_override(&self) -> Result<(), Error>

pub fn detach_override(&self) -> Result<(), Error>

§

impl INodeComponentBase

pub fn add_message_handler<T>( &self, message_type: &MessageType<T>, closure: impl Handler, ) -> Result<MessageSubscriptionToken, Error>

Kanzi calls the message handler that you add using this function when the target name of the incoming message matches the name of this node component, or if the message is broadcast to all node components with an empty target name.

§Arguments
  • message_type - Type of message to handle.
  • closure - The callback that will be invoked when this node component receives a message.
§Returns

Message subscription token.

pub fn remove_message_filter( &self, token: &MessageSubscriptionToken, ) -> Result<(), Error>

Removes message handler added via add_message_handler function.

§Arguments
  • token - Subscription token of message handler to remove.

pub fn dispatch_message<T>( &self, message_type: &MessageType<T>, message_arguments: &T, ) -> Result<(), Error>

Adds the name of the node component to the message arguments and dispatches the message to the node of the node component.

§Arguments
  • message_type - The type of the dispatched message.
  • message_arguments - The arguments of the dispatched message.

pub fn dispatch_abstract_message<T>( &self, message_type: &MessageType<T>, message_arguments: &MessageArguments, ) -> Result<(), Error>

Adds the name of the node component to the abstract message arguments and dispatches the message to the node of the node component.

§Arguments
  • message_type - The abstract type of the dispatched message.
  • message_arguments - The abstract arguments of the dispatched message.

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AsAny for T
where T: 'static,

§

fn as_any(&self) -> &(dyn Any + 'static)

§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Inherits<T> for T

§

fn upcast(self) -> Base

§

fn upcast_ref(&self) -> &Base

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.