Expand description
A Rust crate which allows to build a configuration files based on scheme and serialize it into JSON or binary formats in order to deserialize it later. Also to autogenerate the Rust structures for desearilization dynamically during building.
See project repository for examples and description.
Re-exports§
pub extern crate bincode;
pub extern crate bitflags;
pub extern crate linked_hash_map;
pub extern crate serde;
pub extern crate serde_json;
pub use lexer::lexer::Lexer;
pub use lexer::lexer_info::LexerInfo;
pub use static_scheme::generator::RustCodeDerives;
pub use static_scheme::init::SchemeInit;
pub use static_scheme::generator::RustCode;
pub use static_scheme::error::StaticSchemeRes;
pub use static_scheme::error::StaticSchemeError;
pub use static_scheme::container::StaticSchemes;
pub use static_scheme::scheme::Serializator;
pub use static_scheme::analyzer::AnalyzerErrors;
pub use dynamic_scheme::environment::DynEnvironment;
pub use dynamic_scheme::environment::DynProcedure;
pub use dynamic_scheme::error::DynSchmRes;
pub use dynamic_scheme::error::DynSchmError;
pub use serializator::serializator::Serialization;
pub use serializator::error::SerializationErrorPartial;
pub use serializator::error::SerializationPartialRes;
pub use serializator::error::SerializationRes;
pub use serializator::error::SerializationError;
pub use crate::loader::config_cnode::CNode;
pub use crate::loader::config_loader_local::ConfigLocaFileSystem;
pub use crate::loader::config_loader::ConfigInitSource;
pub use crate::loader::config_loader::ConfigLoader;
pub use crate::loader::config_collector::ConfigCollector;
Modules§
Macros§
- comp_
throw_ scmp - comp_
throw_ text - lex_err
- lex_
err1 - lex_
iter_ err - map_
comp_ throw_ scmp - map_
comp_ throw_ text - map_
dyn_ nr - map_
into_ dyn_ throw_ li - map_
into_ dyn_ throw_ msg - map_
lex_ err - map_
lex_ err1 - map_
new_ static_ throw_ text - map_
root - map_
ser_ partial_ throw - map_
serial_ throw_ add - map_
serial_ throw_ all - map_
static_ nr - map_
static_ root - ret_
dyn_ nr - ret_
static_ nr - ser_
partial_ throw - serial_
throw_ all - serial_
throw_ li - serial_
throw_ text - static_
throw_ text
Functions§
- collect_
config - Prepares the instance of the collector of config file. It is based on the CNode storage. However, if a custom storage mechanism is required, for example (zip) then implement a trait in your program.
- deserialize
- Performs deserialization of the data into the type
S
from the JSON. - dynamic_
scheme_ file_ single - A dynamic scheme file parsing based on the description from the statis scheme.
- load_
config - Prepares the config loader from local file system and performing setup of environment from
static_cfg_source
- ConfigInitSource. - rustcode_
generate - Generates a Rust code from the serializator (a static scheme). This is a simple realizaton. For compels, see examples.
- serialize
- Performs serialization of the data in DynProcedure instance according to the description in Serializator instance. And then the result is serialized as JSON and returnd as String.
- static_
scheme_ analyze - Calls scheme analyzer to find any unused items or incorrect path references.
- static_
scheme_ init - Initializes a SchemeInit instance. This is usefull when it is required to perform some custom actions and reuse instance.
- static_
scheme_ init_ basepath - Initializes a SchemeInit instance with the
basepath
which is a path to the root directory where usually aninit.shm
fle is located. - static_
scheme_ init_ multiple - Reads multiple files which contains a description of the serializator in single
StaticSchemes instance. If you have some
init.shm
which includes other files, then use static_scheme_init_multiple. - static_
scheme_ init_ single - Reads a single file which contains a description of the serializator. If you have some
init.shm
which includes other files, then use static_scheme_init_multiple. - static_
scheme_ run - Initializes a SchemeInit instance with the
basepath
which is a path to the root directory where usually aninit.shm
fle is located and aninit.shm
file relative location. - store_
file - A helper function which could be used to store the config file in the ConfigCollector.
- store_
raw_ file - A helper function which could be used to store the text file in the ConfigCollector.