pub enum PreCheckOutcome {
Pass,
NeedLength(usize),
Fail(ModbusError),
InsufficientData,
}Expand description
Outcome of a single PreCheck evaluation against an incoming Framing.
Mirrors the return values of master-session.ts’s preCheck functions
(undefined | number | boolean).
Variants§
Pass
This check accepts the frame; move on to the next check.
NeedLength(usize)
The frame’s data must be exactly this many bytes:
data.len() < n→ rejected asInsufficientDatadata.len() != n→ rejected asInvalidResponsedata.len() == n→ passes
Fail(ModbusError)
Reject with the given error and stop pre-checking.
InsufficientData
Equivalent to njs undefined: the check can’t decide yet; treated
as InsufficientData.
Trait Implementations§
Source§impl Clone for PreCheckOutcome
impl Clone for PreCheckOutcome
Source§fn clone(&self) -> PreCheckOutcome
fn clone(&self) -> PreCheckOutcome
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PreCheckOutcome
impl !RefUnwindSafe for PreCheckOutcome
impl Send for PreCheckOutcome
impl Sync for PreCheckOutcome
impl Unpin for PreCheckOutcome
impl UnsafeUnpin for PreCheckOutcome
impl !UnwindSafe for PreCheckOutcome
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more