Module panopticon_core::region [] [src]

A regions model continuous memory like RAM, flash memory or files.

A region has an unique name that is used to reference it and a size. The size is the number of Cells in a region. A cell either has a value between 0 and 255 or is undefined. Cells are numbered in ascending order starting at 0.

Regions can be constructed from files or buffers in memory or be filled with undefined values.

Examples

use std::path::Path;
use panopticon_core::Region;
let file_region = Region::open("file".to_string(),Path::new("path/to/file"));

This region is named "file" and is filled with the contents of "path/to/file"

use panopticon_core::Region;
let buf = vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
let buf_region = Region::wrap("buf".to_string(),buf);

This region is named "buf" and is initialized with the contents of buf.

use panopticon_core::Region;
let undefined_region = Region::undefined("undef".to_string(),4096);

This region is named "undef" and is just 4k of undefined cells

Structs

Region

A continuous sequcence of Cells

World

A set of Regions

Type Definitions

RegionGraph

Graph that models overlapping regions.

RegionRef

Stable reference for a node in a region graph.