pub struct Parser<'a> { /* private fields */ }
Expand description
Wraps a artichoke_backend
mruby parser.
Implementations§
source§impl<'a> Parser<'a>
impl<'a> Parser<'a>
sourcepub fn new(interp: &'a mut Artichoke) -> Option<Self>
pub fn new(interp: &'a mut Artichoke) -> Option<Self>
Create a new parser from an interpreter instance.
sourcepub fn parse(&mut self, code: &[u8]) -> Result<State, Error>
pub fn parse(&mut self, code: &[u8]) -> Result<State, Error>
Parse the code buffer to determine if the code is a complete expression that could be evaluated even though it may not be syntactically or semantically valid.
Errors
If the supplied code is more than isize::MAX
bytes long, an error is
returned,
If the underlying parser returns a UTF-8 invalid error message, an error is returned.
Trait Implementations§
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Parser<'a>
impl<'a> !Send for Parser<'a>
impl<'a> !Sync for Parser<'a>
impl<'a> Unpin for Parser<'a>
impl<'a> !UnwindSafe for Parser<'a>
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