[][src]Struct ktx2_reader::Reader

pub struct Reader<T> { /* fields omitted */ }

Struct to read KTX v.2 files.

Implementations

impl<T: AsyncRead + AsyncSeek + Unpin> Reader<T>[src]

Implementation of Reader struct for async loading.

pub async fn new(__arg0: T) -> ReadResult<Self>[src]

Create new instance of Reader.
Asyncroniosly reads and tries to parse data from input.

Errors

If reading fails, returns ReadError::IoError.
If parsing fails, returns ReadError::ParseError.

pub async fn read_data<'_>(&'_ mut self) -> ReadResult<Vec<u8>>[src]

Reads data of texture.
Gets vector of bytes. It stores color data of texture. Layout of this data can be obtined from regions_description() method of self.

pub async fn read_data_to<'_, '_>(
    &'_ mut self,
    buf: &'_ mut [u8]
) -> ReadToResult<()>
[src]

Reads data of texture.

Reads texture data to buf. Layout of this data can be obtined from regions_description() method of self.
Size of buf MUST be equal to expected data size. It can be obtained with data_len_bytes() method.

pub fn header(&self) -> &Header[src]

Returns Header of texture.

pub fn regions_description(&self) -> Vec<RegionDescription>[src]

Returns vector of RegionDescription for texture.

pub fn data_len_bytes(&self) -> u64[src]

Full length of texture data.

Auto Trait Implementations

impl<T> RefUnwindSafe for Reader<T> where
    T: RefUnwindSafe

impl<T> Send for Reader<T> where
    T: Send

impl<T> Sync for Reader<T> where
    T: Sync

impl<T> Unpin for Reader<T> where
    T: Unpin

impl<T> UnwindSafe for Reader<T> where
    T: UnwindSafe

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.