pub struct Node<Service: Service> { /* private fields */ }
Expand description
The Node
is the entry point to the whole iceoryx2 infrastructure and owns all entities.
As soon as a process crashes other processes can detect dead Node
s via Node::list()
and clean up the stale resources - the entities that
were created via the Node
.
Can be created via the NodeBuilder
.
Implementations§
Source§impl<Service: Service> Node<Service>
impl<Service: Service> Node<Service>
Sourcepub fn service_builder(&self, name: &ServiceName) -> Builder<Service>
pub fn service_builder(&self, name: &ServiceName) -> Builder<Service>
Instantiates a ServiceBuilder
for a service with the provided name.
Sourcepub fn list<F: FnMut(NodeState<Service>) -> CallbackProgression>(
config: &Config,
callback: F,
) -> Result<(), NodeListFailure>
pub fn list<F: FnMut(NodeState<Service>) -> CallbackProgression>( config: &Config, callback: F, ) -> Result<(), NodeListFailure>
Calls the provided callback for all Node
s in the system under a given Config
and
provides NodeState<Service>
as input argument. With every iteration the callback has to
return CallbackProgression::Continue
to perform the next iteration or
CallbackProgression::Stop
to stop the iteration immediately.
Node::<ipc::Service>::list(Config::global_config(), |node_state| {
println!("found node {:?}", node_state);
CallbackProgression::Continue
});
Sourcepub fn wait(&self, cycle_time: Duration) -> Result<(), NodeWaitFailure>
pub fn wait(&self, cycle_time: Duration) -> Result<(), NodeWaitFailure>
Waits until the cycle time has passed. It returns NodeWaitFailure::TerminationRequest
when a SIGTERM
signal was received or NodeWaitFailure::Interrupt
when a SIGINT
signal was received.
Sourcepub fn signal_handling_mode(&self) -> SignalHandlingMode
pub fn signal_handling_mode(&self) -> SignalHandlingMode
Returns the SignalHandlingMode
with which the Node
was created.