pub struct Tactic {
pub name: String,
pub description: Option<String>,
pub shortname: String,
/* private fields */
}
Fields§
§name: String
§description: Option<String>
§shortname: String
The kebab-case name used in KillChainPhase
to reference this tactic.
Implementations§
Source§impl Tactic
impl Tactic
Sourcepub fn mitre_id(&self) -> Option<&str>
pub fn mitre_id(&self) -> Option<&str>
Get the MITRE ATT&CK ID for this tactic, such as TA0001
.
Examples found in repository?
examples/print_matrix.rs (line 72)
70 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
71 for (tactic, techniques) in &self.columns {
72 write!(f, "{} ({}) | ", tactic.name, tactic.mitre_id().unwrap())?;
73 if techniques.is_empty() {
74 writeln!(f, "No techniques")?;
75 continue;
76 }
77
78 write!(f, "{}", techniques[0].name())?;
79
80 for technique in &techniques[1..3] {
81 write!(f, ", {}", technique.name())?;
82 }
83
84 if techniques.len() > 4 {
85 writeln!(f, " +{} more", techniques.len() - 4)?;
86 } else {
87 writeln!(f)?;
88 }
89 }
90
91 Ok(())
92 }
Trait Implementations§
Source§impl AsRef<CommonProperties> for Tactic
impl AsRef<CommonProperties> for Tactic
Source§fn as_ref(&self) -> &CommonProperties
fn as_ref(&self) -> &CommonProperties
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<'de> Deserialize<'de> for Tactic
impl<'de> Deserialize<'de> for Tactic
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Tactic
impl RefUnwindSafe for Tactic
impl Send for Tactic
impl Sync for Tactic
impl Unpin for Tactic
impl UnwindSafe for Tactic
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