gbf_core::bytecode_loader

Struct BytecodeLoaderBuilder

Source
pub struct BytecodeLoaderBuilder<R> { /* private fields */ }
Expand description

A builder for a BytecodeLoader.

Implementations§

Source§

impl<R: Read> BytecodeLoaderBuilder<R>

Source

pub fn new(reader: R) -> Self

Creates a new BytecodeLoaderBuilder.

§Arguments
  • reader: The reader to read the bytecode from.
§Returns
  • A new BytecodeLoaderBuilder instance.
§Example
use gbf_core::bytecode_loader::BytecodeLoaderBuilder;

let reader = std::io::Cursor::new(vec![0x00, 0x00, 0x00, 0x00]);
let builder = BytecodeLoaderBuilder::new(reader);
Source

pub fn build(self) -> Result<BytecodeLoader<R>, BytecodeLoaderError>

Builds a BytecodeLoader from the builder.

§Returns
  • A Result containing the BytecodeLoader if successful.
§Errors
  • BytecodeLoaderError::InvalidSectionType if an invalid section type is encountered.
  • BytecodeLoaderError::InvalidSectionLength if an invalid section length is encountered.
  • BytecodeLoaderError::StringIndexOutOfBounds if a string index is out of bounds.
  • BytecodeLoaderError::NoPreviousInstruction if there is no previous instruction when setting an operand.
  • BytecodeLoaderError::GraalIo if an I/O error occurs.
  • BytecodeLoaderError::OpcodeError if an invalid opcode is encountered.

Auto Trait Implementations§

§

impl<R> Freeze for BytecodeLoaderBuilder<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for BytecodeLoaderBuilder<R>
where R: RefUnwindSafe,

§

impl<R> Send for BytecodeLoaderBuilder<R>
where R: Send,

§

impl<R> Sync for BytecodeLoaderBuilder<R>
where R: Sync,

§

impl<R> Unpin for BytecodeLoaderBuilder<R>
where R: Unpin,

§

impl<R> UnwindSafe for BytecodeLoaderBuilder<R>
where R: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.