Skip to main content

Crate mechutil

Crate mechutil 

Source

Re-exports§

pub use config_overlay::apply_configuration_overlay;
pub use config_overlay::read_active_configuration;
pub use config_overlay::read_ini_value;
pub use config_overlay::resolve_active_config;
pub use config_overlay::ConfigResolveError;
pub use rotating_file_writer::RotatingFileWriter;
pub use run_log::create_run_log;
pub use run_log::open_default_run_log;
pub use run_log::resolve_log_dir;
pub use run_log::RunLog;
pub use service_logger::init_service_logger;
pub use service_logger::ServiceLog;
pub use service_logger::MAX_RUN_BYTES;
pub use paths::resolve_config_dir;

Modules§

aclog
aclog: allocation-free, lock-free logging for real-time code (records, queues, macros, wire format, logging.json definitions). aclog: logging for real-time code that never allocates or blocks.
actor
An actor for tick events and command routing.
async_bus
Low-latency bus communication
async_channel
Asynchronous, bi-directional comms channel. An asynchronous, bi-directional channel meant for communicating via an internal bus. We use tokio mpsc (multi-producer, single consumer) channels because tokio typically runs through all or projects.
command
CommandMessage and CommandMessageResult. Used for our message pipelines and IPC.
command_arg_tuple
MechFsmCommandArgTuple The MechFsmCommandArgTuple attempts to reduce the number transmissions required to execute a command by allowing for multiple arguments or varying types in the same transmission. To do so, values are serialized into the data field, with separate arrays tracking type information and value length. The data field can store up to 255 arguments, based upon argument length. For 255 values, every column would need to be a byte. If every argument was four bytes long, the maximum number of arguments would be 63.
command_fsm
config_overlay
Machine “configuration” overlays: named sparse patches applied on top of a module’s base config to select a hardware build. See config_overlay docs. Machine “configuration” overlays for module configs.
corelink
Corelink IPC Protocol
cpu_layout
The machine’s CPU layout (config.ini [cpu]), planned by actune and applied by the server while it is live. See cpu_layout docs. The machine’s CPU layout: which cores run the cyclic chain, which run the processes that serve it, and which run everything else.
heartbeat
ipc
IPC module for CommandMessage-based communication between autocore-server and external modules. Provides ModuleHandler trait (analogous to AsyncServelet), TCP transport with length-prefix framing, and TopicRouter for message dispatch.
notifier
One-to-many notifier. Some cool lifetime concepts, but tokio::channels are usually a better choice.
object_dictionary
An object dictionary similar to CANopen or CoE, used as registers with CommandFsm implementations. This module provides an implementation based upon the CANopen object dictionary or CAN over EtherCAT (CoE) systems. The object dictionary is the core mechanism for configuration and communication with CANopen devices. Each entry in the dictionary is represented by an index, which may contain sub-indices for more complex data structures such as arrays and records.
paths
Shared autocore filesystem locations (config dir resolution). Shared autocore filesystem locations.
realtime
Real-time process hygiene (memory locking) shared by the cyclic binaries. Real-time process hygiene shared by every AutoCore binary that runs a cyclic loop.
register_value
Register value used for flexible communication with a Codesys-based PLC, although it should be compatible with any controller.
rotating_file_writer
Size-limited rotating file writer for bounded log disk usage. Size-limited rotating file writer.
run_log
Per-run timestamped log files with bounded run-count retention (<base>.<YYYYMMDDThhmmss>.log, keeping the newest N runs). Per-run log files with bounded retention.
service_logger
One-call service logger setup: per-run file + size cap + simplelog, wired together so the disk-usage cap can’t be left out. One-call service logger setup for autocore binaries.
shm
Shared Memory mapping
shm_header
Self-describing header + layout fingerprint for the cyclic GM shared-memory segment. Shared by autocore-server (segment creator + codegen) and autocore-std (control program) so a layout/ABI mismatch fails loud instead of reading mismapped memory.
subscription
Subscription mechanism, intended for async nodes to subscribe to messages.
ton
Timer on delay.
tool_registry
Tool & editor registry: external packages contribute tools/editors via manifests in <config>/tools.d, discovered by the server and the IDE. See doc/tool-registry.md. Autocore tool & editor registry.
tool_settings
Runtime settings for registered tools (<config>/tool-settings), two-tier: a reserved launch block the server reads plus free-form tool-private state. Runtime settings for registered tools.
units
Engineering units + display scales (the units.json sidecar). See autocore-server/UNITS_PLAN.md. Engineering units and display scales — the ecosystem’s single definition.
variant
Variant data type. Variant type used for communications and other purposes. A good example of a Variant type used in a similar application is in the locka99/opcua implementation found here: https://github.com/locka99/opcua/blob/master/lib/src/types/variant.rs

Macros§

aclog_bookmark
Store a bookmark: aclog::bookmark!("before the retune"). Formatted into a 256-byte stack buffer; not broadcast to viewers unless they ask.
aclog_custom_debug
Emit an unregistered message at this level, formatted into a 256-byte stack buffer: aclog::custom_<level>!("fmt", args...).
aclog_custom_error
Emit an unregistered message at this level, formatted into a 256-byte stack buffer: aclog::custom_<level>!("fmt", args...).
aclog_custom_info
Emit an unregistered message at this level, formatted into a 256-byte stack buffer: aclog::custom_<level>!("fmt", args...).
aclog_custom_process
Emit an unregistered message at this level, formatted into a 256-byte stack buffer: aclog::custom_<level>!("fmt", args...).
aclog_custom_system
Emit an unregistered message at this level, formatted into a 256-byte stack buffer: aclog::custom_<level>!("fmt", args...).
aclog_custom_warn
Emit an unregistered message at this level, formatted into a 256-byte stack buffer: aclog::custom_<level>!("fmt", args...).
aclog_debug
Emit a registered message at this level: aclog::<level>!(group, key, args...).
aclog_error
Emit a registered message at this level: aclog::<level>!(group, key, args...).
aclog_info
Emit a registered message at this level: aclog::<level>!(group, key, args...).
aclog_post
Mark a predefined system event: aclog::post!(aclog::events::CYCLE_START).
aclog_process
Emit a registered message at this level: aclog::<level>!(group, key, args...).
aclog_system
Emit a registered message at this level: aclog::<level>!(group, key, args...).
aclog_warn
Emit a registered message at this level: aclog::<level>!(group, key, args...).

Constants§

SHM_ABI_VERSION
ABI version of any type that lives inside the cyclic SHM segment (signal Event primitives, packed reprs, register encodings, etc.). Bump this ONLY when such a binary representation changes — NOT on every release. This, not VERSION, is the hard ABI gate between server and control program.
VERSION
Human-facing package version (shown by acctl and in logs). Compiled into the binary, so it reflects what the running process was actually built with — unlike parsing a Cargo.toml off disk.