[][src]Struct p8n_types::Bitcode

pub struct Bitcode { /* fields omitted */ }

Memory conserving representation of IL code.

Methods

impl Bitcode[src]

pub fn append<I: IntoIterator<Item = Statement> + Sized>(
    &mut self,
    i: I
) -> Result<Range<usize>>
[src]

Appends statements in i to the bitcode vector, returing the new byte range.

pub fn new(v: Vec<Statement>) -> Result<Bitcode>[src]

Creates a new Bitcode instance from v.

pub fn with_capacity(cap: usize) -> Bitcode[src]

Creates an empty Bitcode vector with initial capacity cap.

pub fn rewrite<F: FnMut(&mut Statement, &mut Names, &mut Strings, &mut Segments) -> Result<RewriteControl> + Sized>(
    &mut self,
    range: Range<usize>,
    names: &mut Names,
    strings: &mut Strings,
    segments: &mut Segments,
    func: F
) -> Result<Range<usize>>
[src]

Maps function func over all statements in range, and writing them back into the vector.

pub fn remove(&mut self, range: Range<usize>)[src]

Removes the serialized statements inside range.

pub fn insert(
    &mut self,
    pos: usize,
    stmts: Vec<Statement>
) -> Result<Range<usize>>
[src]

Serializes the statements in stmts and writes the bytes into position pos. Returns the inserted byte range.

Important traits for BitcodeIter<'a>
pub fn iter<'a>(&'a self) -> BitcodeIter<'a>[src]

Iterator over all statements.

Important traits for BitcodeIter<'a>
pub fn iter_range<'a>(&'a self, rgn: Range<usize>) -> BitcodeIter<'a>[src]

Iterator over all statements inside byte range rgn.

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

Number of bytes of serialized statements.

Trait Implementations

impl Clone for Bitcode[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Default for Bitcode[src]

impl Debug for Bitcode[src]

Auto Trait Implementations

impl Send for Bitcode

impl Sync for Bitcode

Blanket Implementations

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

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

type Owned = T

impl<T> From for T[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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