[F53 partial] enable #![warn(missing_docs)] on consumer crates
mxaccess + mxaccess-compat now carry #![warn(missing_docs)] at the crate root. Every public item has at least a one-line doc comment (struct fields, enum variants, trait methods all covered). Touched items: - mxaccess::lib: DataChange fields, SecurityContext fields, TransportKind variants, TransportCapabilities fields, RecoveryEvent variants + their inner fields, SessionOptions fields, the full Error / ConnectionError / AuthError / ProtocolError / ConfigError / SecurityError taxonomy + nested fields, Transport trait method docs. - mxaccess-compat::lib: DataChangeEvent / BufferedDataChangeEvent / WriteCompleteEvent / OperationCompleteEvent fields. Protocol crates (codec, rpc, galaxy, nmx, callback, asb, asb-nettcp) deliberately left without the lint per F53's strategy paragraph — their consumers (mxaccess + mxaccess-compat) already document the surfaces they re-export, and forcing one-liners on every transport-internal item adds noise without consumer value. Verification: - `RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps` clean. - `cargo test --workspace` (824 tests) green. - `cargo clippy --workspace --all-targets -- -D warnings` clean. design/followups.md F53 marked partially resolved. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -50,6 +50,7 @@
|
||||
//! live-trigger work.
|
||||
|
||||
#![forbid(unsafe_code)]
|
||||
#![warn(missing_docs)]
|
||||
|
||||
use std::collections::{HashMap, VecDeque};
|
||||
use std::pin::Pin;
|
||||
@@ -73,12 +74,20 @@ use tokio_stream::wrappers::BroadcastStream;
|
||||
/// `MxNativeDataChangeEvent` (`MxNativeCompatibilityServer.cs:6-13`).
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct DataChangeEvent {
|
||||
/// LMX server handle that produced this event.
|
||||
pub server_handle: i32,
|
||||
/// Item handle within `server_handle` whose value changed.
|
||||
pub item_handle: i32,
|
||||
/// Decoded value payload.
|
||||
pub value: MxValue,
|
||||
/// Legacy 16-bit OPC quality.
|
||||
pub quality: u16,
|
||||
/// Wire-recorded timestamp (Windows FILETIME-derived).
|
||||
pub timestamp: SystemTime,
|
||||
/// Richer category-model status (complements `quality`).
|
||||
pub status: MxStatus,
|
||||
/// `true` when the event was emitted while a `recover_connection`
|
||||
/// attempt was in flight.
|
||||
pub is_during_recovery: bool,
|
||||
}
|
||||
|
||||
@@ -90,13 +99,21 @@ pub struct DataChangeEvent {
|
||||
/// capture proves multi-sample bodies real.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct BufferedDataChangeEvent {
|
||||
/// LMX server handle that produced this event.
|
||||
pub server_handle: i32,
|
||||
/// Item handle within `server_handle`.
|
||||
pub item_handle: i32,
|
||||
/// `MxDataType` discriminator for the carried values.
|
||||
pub mx_data_type: i16,
|
||||
/// Sample values — length 1 per R2's single-sample verdict.
|
||||
pub values: Vec<MxValue>,
|
||||
/// Per-sample legacy 16-bit OPC qualities. Same length as `values`.
|
||||
pub qualities: Vec<u16>,
|
||||
/// Per-sample timestamps. Same length as `values`.
|
||||
pub timestamps: Vec<SystemTime>,
|
||||
/// Per-sample richer-category status. Same length as `values`.
|
||||
pub statuses: Vec<MxStatus>,
|
||||
/// `true` when the event was emitted during recovery.
|
||||
pub is_during_recovery: bool,
|
||||
}
|
||||
|
||||
@@ -104,9 +121,13 @@ pub struct BufferedDataChangeEvent {
|
||||
/// `MxNativeWriteCompleteEvent` (`cs:15-19`).
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct WriteCompleteEvent {
|
||||
/// LMX server handle that issued the original write.
|
||||
pub server_handle: i32,
|
||||
/// Item handle the write was targeted at.
|
||||
pub item_handle: i32,
|
||||
/// Per-write completion statuses (one per `MXSTATUS_PROXY` slot).
|
||||
pub statuses: Vec<MxStatus>,
|
||||
/// `true` when the write completed while recovery was in flight.
|
||||
pub is_during_recovery: bool,
|
||||
}
|
||||
|
||||
@@ -117,9 +138,13 @@ pub struct WriteCompleteEvent {
|
||||
/// once the trigger is captured.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct OperationCompleteEvent {
|
||||
/// LMX server handle the operation belongs to.
|
||||
pub server_handle: i32,
|
||||
/// Item handle the operation was targeted at.
|
||||
pub item_handle: i32,
|
||||
/// Per-operation statuses.
|
||||
pub statuses: Vec<MxStatus>,
|
||||
/// `true` when the event was emitted during recovery.
|
||||
pub is_during_recovery: bool,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user