pub struct Extractor { /* private fields */ }
Expand description
Decompresses Oodle data to a buffer. Methods are provided for various input types, depending on crate features.
Implementations§
Source§impl Extractor
impl Extractor
Sourcepub fn read<In: Read>(
&mut self,
input: &mut In,
output: &mut [u8],
) -> Result<usize, OozError>
pub fn read<In: Read>( &mut self, input: &mut In, output: &mut [u8], ) -> Result<usize, OozError>
Extracts from an instance of std::io::Read
Input is assumed to be buffered; wrapping unbuffered input with std::io::BufReader
may improve performance
output
should be exactly large enough to hold the uncompressed data
Sourcepub fn read_from_slice(
&mut self,
input: &[u8],
output: &mut [u8],
) -> Result<usize, OozError>
pub fn read_from_slice( &mut self, input: &[u8], output: &mut [u8], ) -> Result<usize, OozError>
Extracts from a byte slice
output
should be exactly large enough to hold the uncompressed data
Sourcepub async fn async_read<In: AsyncRead + Unpin>(
&mut self,
input: &mut In,
output: &mut [u8],
) -> Result<usize, OozError>
Available on crate feature tokio
only.
pub async fn async_read<In: AsyncRead + Unpin>( &mut self, input: &mut In, output: &mut [u8], ) -> Result<usize, OozError>
tokio
only.Extracts from an instance of tokio::io::AsyncRead
Input is assumed to be buffered; wrapping unbuffered input with tokio::io::BufReader
may improve performance
output
should be exactly large enough to hold the uncompressed data
Sourcepub async fn read_from_stream<E: 'static + Error + Send + Sync, In: Stream<Item = Result<Bytes, E>> + Unpin>(
&mut self,
stream: &mut In,
current: Option<Bytes>,
output: &mut [u8],
) -> Result<(usize, Option<Bytes>), OozError>
Available on crate feature async
only.
pub async fn read_from_stream<E: 'static + Error + Send + Sync, In: Stream<Item = Result<Bytes, E>> + Unpin>( &mut self, stream: &mut In, current: Option<Bytes>, output: &mut [u8], ) -> Result<(usize, Option<Bytes>), OozError>
async
only.Extracts from an instance of futures::stream::Stream
Bytes in current
will be prepended to the stream; the Optionread_from_stream
call when extracting multiple compressed
blocks from a stream.
output
should be exactly large enough to hold the uncompressed data
Trait Implementations§
Source§impl FromWasmAbi for Extractor
impl FromWasmAbi for Extractor
Source§impl IntoWasmAbi for Extractor
impl IntoWasmAbi for Extractor
Source§impl LongRefFromWasmAbi for Extractor
impl LongRefFromWasmAbi for Extractor
Source§impl OptionFromWasmAbi for Extractor
impl OptionFromWasmAbi for Extractor
Source§impl OptionIntoWasmAbi for Extractor
impl OptionIntoWasmAbi for Extractor
Source§impl RefFromWasmAbi for Extractor
impl RefFromWasmAbi for Extractor
Source§impl RefMutFromWasmAbi for Extractor
impl RefMutFromWasmAbi for Extractor
Source§impl TryFromJsValue for Extractor
impl TryFromJsValue for Extractor
Source§impl VectorFromWasmAbi for Extractor
impl VectorFromWasmAbi for Extractor
Source§impl VectorIntoWasmAbi for Extractor
impl VectorIntoWasmAbi for Extractor
impl SupportsConstructor for Extractor
impl SupportsInstanceProperty for Extractor
impl SupportsStaticProperty for Extractor
Auto Trait Implementations§
impl Freeze for Extractor
impl RefUnwindSafe for Extractor
impl Send for Extractor
impl Sync for Extractor
impl Unpin for Extractor
impl UnwindSafe for Extractor
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
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::Abi
Source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.