[][src]Struct kerbalobjects::KOFileReader

pub struct KOFileReader { /* fields omitted */ }

Implementations

impl KOFileReader[src]

pub fn new(raw_contents: Vec<u8>) -> Result<KOFileReader, Box<dyn Error>>[src]

pub fn get_current_index(&self) -> usize[src]

Returns the current index of the reader into the byte vector

pub fn eof(&self) -> bool[src]

pub fn pop(&mut self, bytes: usize) -> Result<(), Box<dyn Error>>[src]

Simply discards the next byte from the contents vector, and advances the current index

pub fn next(&mut self) -> Result<u8, Box<dyn Error>>[src]

Reads the next byte from the contents vector and returns it if there is one

pub fn next_count(&mut self, count: usize) -> Result<Vec<u8>, Box<dyn Error>>[src]

Reads count bytes from the contents and returns a vector of them

pub fn peek(&self) -> Result<u8, Box<dyn Error>>[src]

Peeks one byte from the contents

pub fn peek_count(&mut self, count: usize) -> Result<Vec<u8>, Box<dyn Error>>[src]

Peeks count bytes from the contents and returns a vector of them

pub fn read_bytes_into_u32(&mut self, bytes: u8) -> Result<u32, Box<dyn Error>>[src]

pub fn read_boolean(&mut self) -> Result<bool, Box<dyn Error>>[src]

pub fn read_byte(&mut self) -> Result<i8, Box<dyn Error>>[src]

pub fn read_int16(&mut self) -> Result<i16, Box<dyn Error>>[src]

pub fn read_int32(&mut self) -> Result<i32, Box<dyn Error>>[src]

pub fn read_uint16(&mut self) -> Result<u16, Box<dyn Error>>[src]

pub fn read_uint32(&mut self) -> Result<u32, Box<dyn Error>>[src]

pub fn read_float(&mut self) -> Result<f32, Box<dyn Error>>[src]

pub fn read_double(&mut self) -> Result<f64, Box<dyn Error>>[src]

pub fn read_kos_string(&mut self) -> Result<String, Box<dyn Error>>[src]

pub fn read_string(&mut self) -> Result<String, Box<dyn Error>>[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.