[−][src]Struct ktx2_reader::Reader
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]
&'_ mut self,
buf: &'_ mut [u8]
) -> ReadToResult<()>
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,
T: RefUnwindSafe,
impl<T> Send for Reader<T> where
T: Send,
T: Send,
impl<T> Sync for Reader<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Reader<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Reader<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,