Trait Process

Source
pub trait Process {
    // Provided method
    fn process(self) -> Result<ScanResult, ArmorlibError>
       where Self: Sized,
             BinaryObject: From<Self> { ... }
}
Expand description

A trait that allows for the object to be run through the ArmorLib system with only a single call to .process(). This is a perfectly valid way of passing objects through ArmorLib, however coordinator::Process is also available for more granular control.

§Examples

use armorlib::Process;
let data: Vec<u8> = vec![]; // empty data for demo
let scan_result = data.process().unwrap();

Provided Methods§

Implementations on Foreign Types§

Source§

impl Process for Vec<u8>

An empty implementation of Process for Vec<u8>. Because BinaryObject: From<Vec<u8>> is implemented in the binary_object module, no special implementation is necessary here. Provided that binary_object is in scope, you can just call vec.process().

§Examples

use armorlib::binary_object::BinaryObject;
use armorlib::process::Process;
let vec: Vec<u8> = vec![1, 2, 3, 4, 5];
let _scan_result = vec.process().unwrap(); // this is a `ScanResult` object
Source§

impl Process for File

Implementors§

Source§

impl Process for BinaryObject

An empty implementation of Process for BinaryObject. Because BinaryObject: From<BinaryObject>> is implemented in the binary_object module, no special implementation is necessary here. Provided that binary_object is in scope, you can just call binary_object.process().

§Examples

use armorlib::binary_object::BinaryObject;
use armorlib::process::Process;
let vec: Vec<u8> = vec![1, 2, 3, 4, 5];
let bin_obj = BinaryObject::from(vec);
let _scan_result = bin_obj.process().unwrap(); // this is a `ScanResult` object