Struct xc2bit::FuseArray
[−]
[src]
pub struct FuseArray { pub dev_name_str: Option<String>, // some fields omitted }
Struct representing a 2-dimensional fuse array and handles converting xy-coordinates into a single linear index. The x-axis is horizontal and the y-axis is vertical. The origin is at the top-left corner. (This is the standard "computer graphics" coordinate scheme.)
Fields
dev_name_str: Option<String>
Possibly contains a device name
Methods
impl FuseArray
[src]
pub fn get(&self, x: usize, y: usize) -> bool
[src]
Get a fuse value at the particular xy coordinate
pub fn set(&mut self, x: usize, y: usize, val: bool)
[src]
Set the fuse value at the particular xy coordinate
pub fn dim(&self) -> (usize, usize)
[src]
Returns the dimensions of this array as (width, height)
pub fn from_file_contents(in_bytes: &[u8]) -> Result<Self, &'static str>
[src]
Processes the given data and converts it into a FuseArray
struct.
pub fn from_dim(w: usize, h: usize) -> Self
[src]
Constructs a new FuseArray
object with the given dimensions and filled with 0s
pub fn write_to_writer<W: Write>(&self, writer: W) -> Result<(), Error>
[src]
Writes the fuse array to the internal "crbit" file format, which is an ASCII file containing '1' and '0'.
(This format is intended to be compatible with $readmemb
.)
Trait Implementations
impl Index<(usize, usize)> for FuseArray
[src]
type Output = bool
The returned type after indexing.
fn index(&self, coords: (usize, usize)) -> &bool
[src]
Performs the indexing (container[index]
) operation.