Struct armorlib::binary_object::BinaryObject
[−]
[src]
pub struct BinaryObject {
pub file_path: Option<String>,
pub data: Vec<u8>,
}A struct that represents an unstructured piece of binary data in the form of a Vec<u8>.
It also includes the option of having a String to designate the path.
Fields
file_path: Option<String>
The path on the host operating system where this BinaryObject resides. Because this
field is not always applicible (for example, binary objects which exist only in a
database), the possibility of absence is represented in the Option.
data: Vec<u8>
A Vec<u8> of the binary object's data.
Trait Implementations
impl From<Vec<u8>> for BinaryObject[src]
fn from(data: Vec<u8>) -> BinaryObject[src]
Performs the conversion.
impl From<File> for BinaryObject[src]
fn from(file: File) -> BinaryObject[src]
Performs the conversion.
impl Process for BinaryObject[src]
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
fn process(self) -> Result<ScanResult, ArmorlibError> where
Self: Sized,
BinaryObject: From<Self>, [src]
Self: Sized,
BinaryObject: From<Self>,