[−][src]Struct xc2bit::FuseArray
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]
impl IndexMut<(usize, usize)> for FuseArray
[src]
Auto Trait Implementations
impl RefUnwindSafe for FuseArray
impl Send for FuseArray
impl Sync for FuseArray
impl Unpin for FuseArray
impl UnwindSafe for FuseArray
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
T: Send + Sync + UnwindSafe + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,