[][src]Struct xc2bit::FuseArray

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.

impl IndexMut<(usize, usize)> for FuseArray[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.