Struct lib_ruby_parser::source::DecodedInput
source · [−]#[repr(C)]pub struct DecodedInput {
pub name: String,
pub lines: Vec<SourceLine>,
pub bytes: Vec<u8>,
}
Expand description
Decoded input
Fields
name: String
Name of the input
lines: Vec<SourceLine>
Lines list
bytes: Vec<u8>
Decoded bytes
Implementations
sourceimpl DecodedInput
impl DecodedInput
sourcepub fn named<T>(name: T) -> Selfwhere
T: Into<String>,
pub fn named<T>(name: T) -> Selfwhere
T: Into<String>,
Constructs empty DecodedInput with given name
sourcepub fn into_bytes(self) -> Vec<u8>
pub fn into_bytes(self) -> Vec<u8>
Converts itself into owned vector of bytes
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
Trait Implementations
sourceimpl Debug for DecodedInput
impl Debug for DecodedInput
sourceimpl Default for DecodedInput
impl Default for DecodedInput
sourcefn default() -> DecodedInput
fn default() -> DecodedInput
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for DecodedInput
impl Send for DecodedInput
impl Sync for DecodedInput
impl Unpin for DecodedInput
impl UnwindSafe for DecodedInput
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