Struct Malware

Source
pub struct Malware {
    pub base: Malware,
    pub mitre: MitreMalware,
}

Fields§

§base: Malware§mitre: MitreMalware

Implementations§

Source§

impl Malware

Source

pub fn name(&self) -> &str

Examples found in repository?
examples/actor_lookup.rs (line 20)
6fn display_actor<'a>(actor: &Node<'a, IntrusionSet>) {
7    println!("{} ({})", actor.name(), actor.id());
8    println!("============");
9
10    if let Some(description) = actor.description() {
11        println!("{}\n", description);
12    }
13
14    let mut malwares = actor.uses_malware().peekable();
15    if malwares.peek().is_some() {
16        println!("Malware:");
17        for malware in malwares {
18            match malware.resolve() {
19                Some(malware) => {
20                    println!("- {} ({})", malware.name(), malware.id());
21                }
22                None => {
23                    println!("- Unknown Malware");
24                }
25            }
26        }
27    }
28
29    let mut tools = actor.uses_tools().peekable();
30    if tools.peek().is_some() {
31        println!("Tools:");
32        for tool in tools {
33            match tool.resolve() {
34                Some(tool) => {
35                    println!("- {} ({})", tool.name(), tool.id());
36                }
37                None => {
38                    println!("- Unknown Tool");
39                }
40            }
41        }
42    }
43}
Source

pub fn description(&self) -> Option<&str>

Source

pub fn mitre_id(&self) -> Option<&str>

Gets the MITRE ID for this tool, such as S0066.

Trait Implementations§

Source§

impl AsRef<CommonProperties> for Malware

Source§

fn as_ref(&self) -> &CommonProperties

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<'a> AsRef<Malware> for Node<'a, Malware>

Source§

fn as_ref(&self) -> &Malware

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<'de> Deserialize<'de> for Malware

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl TypedObject for Malware

Source§

const TYPE: &'static str = "malware"

The kebab-case type used as the object’s ID prefix and in the type field for declarations of the object. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Object for T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,