action.rs 588 B

12345678910111213141516171819202122232425
  1. use serde::{Deserialize, Serialize};
  2. use std::fmt;
  3. #[derive(Serialize, Deserialize)]
  4. pub struct Action {
  5. #[serde(default)]
  6. name: String,
  7. #[serde(default)]
  8. description: String,
  9. #[serde(default)]
  10. command: String,
  11. #[serde(default)]
  12. disabled: bool,
  13. }
  14. impl fmt::Display for Action {
  15. fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  16. write!(f, "Action {}:\n\t\"{}\"\n\tCommand: \"{}\"\n\tDisabled: {}",
  17. self.name,
  18. self.description,
  19. self.command,
  20. self.disabled
  21. );
  22. }
  23. }