#[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§
Source§impl DecodedInput
impl DecodedInput
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§
Source§impl Debug for DecodedInput
impl Debug for DecodedInput
Source§impl Default for DecodedInput
impl Default for DecodedInput
Source§fn default() -> DecodedInput
fn default() -> DecodedInput
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DecodedInput
impl RefUnwindSafe for DecodedInput
impl Send for DecodedInput
impl Sync for DecodedInput
impl Unpin for DecodedInput
impl UnwindSafe for DecodedInput
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