Struct lib_ruby_parser::source::Input
source · [−]#[repr(C)]pub struct Input { /* private fields */ }
Expand description
Representation of the source code.
Implementations
sourceimpl Input
impl Input
sourcepub fn new<Name>(name: Name, decoder: Option<Decoder>) -> Selfwhere
Name: Into<String>,
pub fn new<Name>(name: Name, decoder: Option<Decoder>) -> Selfwhere
Name: Into<String>,
Constructs a new input
sourcepub fn update_bytes(&mut self, bytes: Vec<u8>)
pub fn update_bytes(&mut self, bytes: Vec<u8>)
Populates Input
with a given byte array
sourcepub fn line_col_for_pos(&self, pos: usize) -> Option<(usize, usize)>
pub fn line_col_for_pos(&self, pos: usize) -> Option<(usize, usize)>
Returns (line, col) pair for a given byte offset.
Returns None if given offset is out of range.
Returns raw bytes after decoding
sourcepub fn into_bytes(self) -> Vec<u8>
pub fn into_bytes(self) -> Vec<u8>
Converts itself into owned vector of bytes
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Input
impl !Send for Input
impl !Sync for Input
impl Unpin for Input
impl !UnwindSafe for Input
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more