[−][src]Struct p8n_types::Bitcode
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]
&mut self,
i: I
) -> Result<Range<usize>>
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]
&mut self,
range: Range<usize>,
names: &mut Names,
strings: &mut Strings,
segments: &mut Segments,
func: F
) -> Result<Range<usize>>
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]
&mut self,
pos: usize,
stmts: Vec<Statement>
) -> Result<Range<usize>>
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]
ⓘImportant traits for BitcodeIter<'a>
Iterator over all statements.
ⓘImportant traits for BitcodeIter<'a>pub fn iter_range<'a>(&'a self, rgn: Range<usize>) -> BitcodeIter<'a>
[src]
ⓘImportant traits for BitcodeIter<'a>
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(&self) -> 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
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,