dimas_core/traits/
capability.rs

1// Copyright © 2024 Stephan Kunz
2#![allow(unused_imports)]
3//! Core traits of `DiMAS`
4//!
5
6#[doc(hidden)]
7extern crate alloc;
8
9#[cfg(feature = "std")]
10extern crate std;
11
12// region:		--- modules
13use crate::{
14	enums::{OperationState, TaskSignal},
15	error::Result,
16	message_types::{Message, QueryableMsg},
17	utils::selector_from,
18};
19use alloc::{string::String, sync::Arc};
20use core::fmt::Debug;
21#[cfg(feature = "std")]
22use tokio::sync::mpsc::Sender;
23use zenoh::Session;
24// endregion:	--- modules
25
26// region:		--- Capability
27/// Commonalities for capability components
28pub trait Capability: Debug {
29	/// Checks whether state of capability component is appropriate for the given [`OperationState`].
30	/// If not, implementation has to adjusts components state to needs.
31	/// # Errors
32	fn manage_operation_state(&self, state: &OperationState) -> Result<()>;
33}
34// endregion:	--- Capability