dimas_core/traits/
capability.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright © 2024 Stephan Kunz
#![allow(unused_imports)]
//! Core traits of `DiMAS`
//!

#[doc(hidden)]
extern crate alloc;

#[cfg(feature = "std")]
extern crate std;

// region:		--- modules
use crate::{
	enums::{OperationState, TaskSignal},
	error::Result,
	message_types::{Message, QueryableMsg},
	utils::selector_from,
};
use alloc::{string::String, sync::Arc};
use core::fmt::Debug;
#[cfg(feature = "std")]
use tokio::sync::mpsc::Sender;
use zenoh::Session;
// endregion:	--- modules

// region:		--- Capability
/// Commonalities for capability components
pub trait Capability: Debug {
	/// Checks whether state of capability component is appropriate for the given [`OperationState`].
	/// If not, implementation has to adjusts components state to needs.
	/// # Errors
	fn manage_operation_state(&self, state: &OperationState) -> Result<()>;
}
// endregion:	--- Capability