Skip to main content

Crate mechutil

Crate mechutil 

Source

Re-exports§

pub use config_overlay::apply_configuration_overlay;
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§

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
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.
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.
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

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.