castep_param_io/param/general/
stop.rs

1use std::fmt::Display;
2
3use serde::{Deserialize, Serialize};
4
5use crate::param::KeywordDisplay;
6
7#[derive(
8    Debug, Clone, Copy, Hash, Serialize, Deserialize, Default, PartialEq, Eq, PartialOrd, Ord,
9)]
10/// This keyword, if present, will cause the current run to be aborted as if RUN_TIME had been exceeded.
11///
12/// CASTEP checks the contents of the input file periodically during a run. This allows you to modify certain parameters and also to terminate the run early.
13///
14/// This keyword is valid only when the input file is reread. It is ignored if it is present at the start of a run.
15/// # Example
16/// `STOP`
17pub struct Stop;
18impl Display for Stop {
19    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20        f.write_str("")
21    }
22}
23
24impl KeywordDisplay for Stop {
25    fn field(&self) -> String {
26        "STOP".to_string()
27    }
28    fn output(&self) -> String {
29        self.field()
30    }
31}