[][src]Struct ch8alib::codegen::AddrTable

pub struct AddrTable { /* fields omitted */ }

Manages label-to-address relationships

Methods

impl AddrTable[src]

pub fn new() -> Self[src]

Constructs a new AddrTable instance

Returns

A new AddrTable instance with no data

pub fn get_size(&self) -> u32[src]

Gets the number of entries in the table

Returns

The number of entries in the table

pub fn add_entry(&mut self, label: &str, addr: u16)[src]

Adds an entry to the table

Arguments

  • label - The label to add to the table
  • addr - The address corresponding to the label

pub fn has_entry(&self, label: &str) -> bool[src]

Determines whether a given label exists in the table

Argument

  • label - The label to check

Returns

Whether the given label exists in the table

pub fn get_entry(&self, label: &str) -> Result<u16, AddrError>[src]

Gets the address for a given label

Argument

  • label - The label to get the address for

Returns

Ok(address) if the label has an entry, Err(AddrError) otherwise

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, 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.