pub struct BytecodeLoaderBuilder<R> { /* private fields */ }Expand description
A builder for a BytecodeLoader.
Implementations§
Source§impl<R: Read> BytecodeLoaderBuilder<R>
impl<R: Read> BytecodeLoaderBuilder<R>
Sourcepub fn new(reader: R) -> Self
pub fn new(reader: R) -> Self
Creates a new BytecodeLoaderBuilder.
§Arguments
reader: The reader to read the bytecode from.
§Returns
- A new
BytecodeLoaderBuilderinstance.
§Example
use gbf_core::bytecode_loader::BytecodeLoaderBuilder;
let reader = std::io::Cursor::new(vec![0x00, 0x00, 0x00, 0x00]);
let builder = BytecodeLoaderBuilder::new(reader);Sourcepub fn build(self) -> Result<BytecodeLoader<R>, BytecodeLoaderError>
pub fn build(self) -> Result<BytecodeLoader<R>, BytecodeLoaderError>
Builds a BytecodeLoader from the builder.
§Returns
- A
Resultcontaining theBytecodeLoaderif successful.
§Errors
BytecodeLoaderError::InvalidSectionTypeif an invalid section type is encountered.BytecodeLoaderError::InvalidSectionLengthif an invalid section length is encountered.BytecodeLoaderError::StringIndexOutOfBoundsif a string index is out of bounds.BytecodeLoaderError::NoPreviousInstructionif there is no previous instruction when setting an operand.BytecodeLoaderError::GraalIoif an I/O error occurs.BytecodeLoaderError::OpcodeErrorif 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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more