rsiot/components/cmp_http_server/mod.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 35 36 37 38 39 40 41 42 43 44 45
//! Компонент для получения данных через HTTP server.
//!
//! Ссылки:
//!
//! - [Документация docs.rs](https://docs.rs/rsiot-http-server/latest/)
//!
//! - [Репозиторий GitHub](https://github.com/Konstantin-Dudersky/rsiot/tree/main/rsiot-http-server)
//!
//! - [Примеры](https://github.com/Konstantin-Dudersky/rsiot/tree/main/rsiot-http-server/examples)
//!
//!
//! Данные возвращаются в виде структур Json. Для более удобного просмотра можно использовать
//! расширения к браузеру, например [JSON Beautifier & Editor](https://chromewebstore.google.com/detail/json-beautifier-editor/lpopeocbeepakdnipejhlpcmifheolpl)
//!
//!
//!
//! ## Пример
//!
//! ```rust
#![doc = include_str!("../../../examples/cmp_http_server_and_client/cmp_http_server.rs")]
//! ```
//!
//! ## Тестирование
//!
//! См. папку .bruno
//!
mod component;
mod config;
mod error;
mod fn_process;
mod routes;
mod shared_state;
mod tasks;
pub use crate::components_config::http_server::{
GetEndpoint, GetEndpointConfig, PutEndpoint, PutEndpointConfig,
};
pub use component::Cmp;
pub use config::Config;
pub use error::Error;
type Result<T> = std::result::Result<T, Error>;
type GetEndpointsHashMap<TMsg> = std::collections::HashMap<String, Box<dyn GetEndpoint<TMsg>>>;
type PutEndpointsHashMap<TMsg> = std::collections::HashMap<String, Box<dyn PutEndpoint<TMsg>>>;