pub struct DeviceHandler {
pub dyn_param: HashMap<String, String>,
/* private fields */
}Fields§
§dyn_param: HashMap<String, String>Dynamic parameters for input substitution (e.g., passwords, system names)
Implementations§
Source§impl DeviceHandler
impl DeviceHandler
Sourcepub fn is_equivalent(&self, other: &DeviceHandler) -> bool
pub fn is_equivalent(&self, other: &DeviceHandler) -> bool
Checks if two DeviceHandlers are equivalent (used for connection parameter comparison).
Sourcepub fn new(config: DeviceHandlerConfig) -> Result<DeviceHandler, ConnectError>
pub fn new(config: DeviceHandlerConfig) -> Result<DeviceHandler, ConnectError>
Creates a new DeviceHandler from a declarative configuration snapshot.
Source§impl DeviceHandler
impl DeviceHandler
Sourcepub fn from_config(config: &DeviceHandlerConfig) -> Result<Self, ConnectError>
pub fn from_config(config: &DeviceHandlerConfig) -> Result<Self, ConnectError>
Build a handler from a public configuration snapshot.
Source§impl DeviceHandler
impl DeviceHandler
Sourcepub fn diagnose_state_machine(&self) -> StateMachineDiagnostics
pub fn diagnose_state_machine(&self) -> StateMachineDiagnostics
Analyze the state transition graph for common template issues.
Source§impl DeviceHandler
impl DeviceHandler
Sourcepub fn read_prompt(&mut self, line: &str) -> bool
pub fn read_prompt(&mut self, line: &str) -> bool
Checks if a line matches a prompt pattern.
Sourcepub fn read_sys_prompt(&mut self, line: &str) -> bool
pub fn read_sys_prompt(&mut self, line: &str) -> bool
Checks if a line matches a system-specific prompt pattern.
Sourcepub fn read_need_write(&mut self, line: &str) -> Option<(String, bool)>
pub fn read_need_write(&mut self, line: &str) -> Option<(String, bool)>
Checks if a line requires input and returns the input to send.
Sourcepub fn current_state(&self) -> &str
pub fn current_state(&self) -> &str
Returns the current state name.
Sourcepub fn current_sys(&self) -> Option<&str>
pub fn current_sys(&self) -> Option<&str>
Returns the currently captured system name, if available.
Sourcepub fn current_prompt(&self) -> Option<&str>
pub fn current_prompt(&self) -> Option<&str>
Returns last prompt text matched by the state machine.
Source§impl DeviceHandler
impl DeviceHandler
Sourcepub fn trans_state_write(
&self,
state: &str,
sys: Option<&String>,
) -> Result<Vec<(String, String)>, ConnectError>
pub fn trans_state_write( &self, state: &str, sys: Option<&String>, ) -> Result<Vec<(String, String)>, ConnectError>
Calculates the commands needed to transition to a target state.
Auto Trait Implementations§
impl Freeze for DeviceHandler
impl RefUnwindSafe for DeviceHandler
impl Send for DeviceHandler
impl Sync for DeviceHandler
impl Unpin for DeviceHandler
impl UnsafeUnpin for DeviceHandler
impl UnwindSafe for DeviceHandler
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