[][src]Struct mif::Mif

pub struct Mif<T: UpperHex + Unsigned + PrimInt + FromPrimitive> { /* fields omitted */ }

Native MIF representation.

Implementations

impl<T> Mif<T> where
    T: UpperHex + Unsigned + PrimInt + FromPrimitive + CheckedShl + WrappingSub
[src]

pub fn new(width: usize) -> Result<Mif<T>, Error>[src]

Creates new MIF with word width.

pub fn max_width() -> usize[src]

Maximum word width in bits depending on T.

pub fn max_align() -> usize[src]

Maximum word width in bytes depending on T.

pub fn max_value(&self) -> T[src]

Maximum word value depending on width().

pub fn width(&self) -> usize[src]

Word width in bits.

pub fn align(&self) -> usize[src]

Word width in bytes.

pub fn depth(&self) -> usize[src]

MIF depth in words.

pub fn words(&self) -> &Vec<(T, usize)>[src]

Reference to words and their bulk in given order.

pub fn areas(&self) -> &Vec<(usize, PathBuf)>[src]

Reference to addresses and paths of memory areas in given order.

pub fn area(&mut self, area: PathBuf)[src]

Addresses memory area at current depth().

pub fn push(&mut self, word: T, bulk: usize) -> Result<(), Error>[src]

Pushes word or add up its bulk.

pub fn join(&mut self, other: &Self) -> Result<(), Error>[src]

Joins in other MIF.

pub fn read(
    &mut self,
    bytes: &mut dyn Read,
    depth: usize,
    first: First
) -> Result<(), Error>
[src]

Reads depth LSB/MSB-first words from bytes reader.

pub fn write(&self, lines: &mut dyn Write, areas: bool) -> Result<(), Error>[src]

Writes MIF to writer.

  • lines: Writer, MIF is written to.
  • areas: Whether to comment memory areas as in -- 0000: name.bin.

Trait Implementations

impl<T: Clone + UpperHex + Unsigned + PrimInt + FromPrimitive> Clone for Mif<T>[src]

impl<T: Debug + UpperHex + Unsigned + PrimInt + FromPrimitive> Debug for Mif<T>[src]

impl<T: Eq + UpperHex + Unsigned + PrimInt + FromPrimitive> Eq for Mif<T>[src]

impl<T: PartialEq + UpperHex + Unsigned + PrimInt + FromPrimitive> PartialEq<Mif<T>> for Mif<T>[src]

impl<T: UpperHex + Unsigned + PrimInt + FromPrimitive> StructuralEq for Mif<T>[src]

impl<T: UpperHex + Unsigned + PrimInt + FromPrimitive> StructuralPartialEq for Mif<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Mif<T> where
    T: RefUnwindSafe

impl<T> Send for Mif<T> where
    T: Send

impl<T> Sync for Mif<T> where
    T: Sync

impl<T> Unpin for Mif<T> where
    T: Unpin

impl<T> UnwindSafe for Mif<T> where
    T: UnwindSafe

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<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.