Skip to main content

AsyncLeb128ReadExt

Trait AsyncLeb128ReadExt 

Source
pub trait AsyncLeb128ReadExt: AsyncInput<Item = u8> {
Show 24 methods // Provided methods fn read_uleb_u8_non_strict_async( &mut self, ) -> impl Future<Output = Result<u8>> + '_ where Self: Unpin { ... } fn read_uleb_u8_strict_async( &mut self, ) -> impl Future<Output = Result<u8>> + '_ where Self: Unpin { ... } fn read_uleb_u16_non_strict_async( &mut self, ) -> impl Future<Output = Result<u16>> + '_ where Self: Unpin { ... } fn read_uleb_u16_strict_async( &mut self, ) -> impl Future<Output = Result<u16>> + '_ where Self: Unpin { ... } fn read_uleb_u32_non_strict_async( &mut self, ) -> impl Future<Output = Result<u32>> + '_ where Self: Unpin { ... } fn read_uleb_u32_strict_async( &mut self, ) -> impl Future<Output = Result<u32>> + '_ where Self: Unpin { ... } fn read_uleb_u64_non_strict_async( &mut self, ) -> impl Future<Output = Result<u64>> + '_ where Self: Unpin { ... } fn read_uleb_u64_strict_async( &mut self, ) -> impl Future<Output = Result<u64>> + '_ where Self: Unpin { ... } fn read_uleb_u128_non_strict_async( &mut self, ) -> impl Future<Output = Result<u128>> + '_ where Self: Unpin { ... } fn read_uleb_u128_strict_async( &mut self, ) -> impl Future<Output = Result<u128>> + '_ where Self: Unpin { ... } fn read_uleb_usize_non_strict_async( &mut self, ) -> impl Future<Output = Result<usize>> + '_ where Self: Unpin { ... } fn read_uleb_usize_strict_async( &mut self, ) -> impl Future<Output = Result<usize>> + '_ where Self: Unpin { ... } fn read_sleb_i8_non_strict_async( &mut self, ) -> impl Future<Output = Result<i8>> + '_ where Self: Unpin { ... } fn read_sleb_i8_strict_async( &mut self, ) -> impl Future<Output = Result<i8>> + '_ where Self: Unpin { ... } fn read_sleb_i16_non_strict_async( &mut self, ) -> impl Future<Output = Result<i16>> + '_ where Self: Unpin { ... } fn read_sleb_i16_strict_async( &mut self, ) -> impl Future<Output = Result<i16>> + '_ where Self: Unpin { ... } fn read_sleb_i32_non_strict_async( &mut self, ) -> impl Future<Output = Result<i32>> + '_ where Self: Unpin { ... } fn read_sleb_i32_strict_async( &mut self, ) -> impl Future<Output = Result<i32>> + '_ where Self: Unpin { ... } fn read_sleb_i64_non_strict_async( &mut self, ) -> impl Future<Output = Result<i64>> + '_ where Self: Unpin { ... } fn read_sleb_i64_strict_async( &mut self, ) -> impl Future<Output = Result<i64>> + '_ where Self: Unpin { ... } fn read_sleb_i128_non_strict_async( &mut self, ) -> impl Future<Output = Result<i128>> + '_ where Self: Unpin { ... } fn read_sleb_i128_strict_async( &mut self, ) -> impl Future<Output = Result<i128>> + '_ where Self: Unpin { ... } fn read_sleb_isize_non_strict_async( &mut self, ) -> impl Future<Output = Result<isize>> + '_ where Self: Unpin { ... } fn read_sleb_isize_strict_async( &mut self, ) -> impl Future<Output = Result<isize>> + '_ where Self: Unpin { ... }
}
Expand description

Future-based LEB128 integer reads from runtime-neutral async inputs.

Target-width usize and isize formats remain platform dependent. Use fixed-width methods for persistent files and cross-platform protocols.

§Cancellation safety

These reads are not cancellation safe. Dropping a pending future leaves bytes already consumed from the input consumed.

§Examples

Define a generic async helper that reads a strict unsigned LEB128 value:

use qubit_io::AsyncInput;
use qubit_io_binary::AsyncLeb128ReadExt;

async fn read_id<I>(input: &mut I) -> std::io::Result<u64>
where
    I: AsyncInput<Item = u8> + Unpin,
{
    input.read_uleb_u64_strict_async().await
}

Provided Methods§

Source

fn read_uleb_u8_non_strict_async( &mut self, ) -> impl Future<Output = Result<u8>> + '_
where Self: Unpin,

Asynchronously reads a non-strict LEB128 u8.

§Returns

Returns the decoded u8.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

§Cancellation safety

This operation is not cancellation safe. Dropping the future retains any bytes already consumed from the input.

Source

fn read_uleb_u8_strict_async(&mut self) -> impl Future<Output = Result<u8>> + '_
where Self: Unpin,

Asynchronously reads a strict LEB128 u8.

§Returns

Returns the decoded u8.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

§Cancellation safety

This operation is not cancellation safe. Dropping the future retains any bytes already consumed from the input.

Source

fn read_uleb_u16_non_strict_async( &mut self, ) -> impl Future<Output = Result<u16>> + '_
where Self: Unpin,

Asynchronously reads a non-strict LEB128 u16.

§Returns

Returns the decoded u16.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

§Cancellation safety

This operation is not cancellation safe. Dropping the future retains any bytes already consumed from the input.

Source

fn read_uleb_u16_strict_async( &mut self, ) -> impl Future<Output = Result<u16>> + '_
where Self: Unpin,

Asynchronously reads a strict LEB128 u16.

§Returns

Returns the decoded u16.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

§Cancellation safety

This operation is not cancellation safe. Dropping the future retains any bytes already consumed from the input.

Source

fn read_uleb_u32_non_strict_async( &mut self, ) -> impl Future<Output = Result<u32>> + '_
where Self: Unpin,

Asynchronously reads a non-strict LEB128 u32.

§Returns

Returns the decoded u32.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

§Cancellation safety

This operation is not cancellation safe. Dropping the future retains any bytes already consumed from the input.

Source

fn read_uleb_u32_strict_async( &mut self, ) -> impl Future<Output = Result<u32>> + '_
where Self: Unpin,

Asynchronously reads a strict LEB128 u32.

§Returns

Returns the decoded u32.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

§Cancellation safety

This operation is not cancellation safe. Dropping the future retains any bytes already consumed from the input.

Source

fn read_uleb_u64_non_strict_async( &mut self, ) -> impl Future<Output = Result<u64>> + '_
where Self: Unpin,

Asynchronously reads a non-strict LEB128 u64.

§Returns

Returns the decoded u64.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

§Cancellation safety

This operation is not cancellation safe. Dropping the future retains any bytes already consumed from the input.

Source

fn read_uleb_u64_strict_async( &mut self, ) -> impl Future<Output = Result<u64>> + '_
where Self: Unpin,

Asynchronously reads a strict LEB128 u64.

§Returns

Returns the decoded u64.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

§Cancellation safety

This operation is not cancellation safe. Dropping the future retains any bytes already consumed from the input.

Source

fn read_uleb_u128_non_strict_async( &mut self, ) -> impl Future<Output = Result<u128>> + '_
where Self: Unpin,

Asynchronously reads a non-strict LEB128 u128.

§Returns

Returns the decoded u128.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

§Cancellation safety

This operation is not cancellation safe. Dropping the future retains any bytes already consumed from the input.

Source

fn read_uleb_u128_strict_async( &mut self, ) -> impl Future<Output = Result<u128>> + '_
where Self: Unpin,

Asynchronously reads a strict LEB128 u128.

§Returns

Returns the decoded u128.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

§Cancellation safety

This operation is not cancellation safe. Dropping the future retains any bytes already consumed from the input.

Source

fn read_uleb_usize_non_strict_async( &mut self, ) -> impl Future<Output = Result<usize>> + '_
where Self: Unpin,

Asynchronously reads a non-strict LEB128 usize.

§Returns

Returns the decoded usize.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

§Cancellation safety

This operation is not cancellation safe. Dropping the future retains any bytes already consumed from the input.

Source

fn read_uleb_usize_strict_async( &mut self, ) -> impl Future<Output = Result<usize>> + '_
where Self: Unpin,

Asynchronously reads a strict LEB128 usize.

§Returns

Returns the decoded usize.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

§Cancellation safety

This operation is not cancellation safe. Dropping the future retains any bytes already consumed from the input.

Source

fn read_sleb_i8_non_strict_async( &mut self, ) -> impl Future<Output = Result<i8>> + '_
where Self: Unpin,

Asynchronously reads a non-strict LEB128 i8.

§Returns

Returns the decoded i8.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

§Cancellation safety

This operation is not cancellation safe. Dropping the future retains any bytes already consumed from the input.

Source

fn read_sleb_i8_strict_async(&mut self) -> impl Future<Output = Result<i8>> + '_
where Self: Unpin,

Asynchronously reads a strict LEB128 i8.

§Returns

Returns the decoded i8.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

§Cancellation safety

This operation is not cancellation safe. Dropping the future retains any bytes already consumed from the input.

Source

fn read_sleb_i16_non_strict_async( &mut self, ) -> impl Future<Output = Result<i16>> + '_
where Self: Unpin,

Asynchronously reads a non-strict LEB128 i16.

§Returns

Returns the decoded i16.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

§Cancellation safety

This operation is not cancellation safe. Dropping the future retains any bytes already consumed from the input.

Source

fn read_sleb_i16_strict_async( &mut self, ) -> impl Future<Output = Result<i16>> + '_
where Self: Unpin,

Asynchronously reads a strict LEB128 i16.

§Returns

Returns the decoded i16.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

§Cancellation safety

This operation is not cancellation safe. Dropping the future retains any bytes already consumed from the input.

Source

fn read_sleb_i32_non_strict_async( &mut self, ) -> impl Future<Output = Result<i32>> + '_
where Self: Unpin,

Asynchronously reads a non-strict LEB128 i32.

§Returns

Returns the decoded i32.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

§Cancellation safety

This operation is not cancellation safe. Dropping the future retains any bytes already consumed from the input.

Source

fn read_sleb_i32_strict_async( &mut self, ) -> impl Future<Output = Result<i32>> + '_
where Self: Unpin,

Asynchronously reads a strict LEB128 i32.

§Returns

Returns the decoded i32.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

§Cancellation safety

This operation is not cancellation safe. Dropping the future retains any bytes already consumed from the input.

Source

fn read_sleb_i64_non_strict_async( &mut self, ) -> impl Future<Output = Result<i64>> + '_
where Self: Unpin,

Asynchronously reads a non-strict LEB128 i64.

§Returns

Returns the decoded i64.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

§Cancellation safety

This operation is not cancellation safe. Dropping the future retains any bytes already consumed from the input.

Source

fn read_sleb_i64_strict_async( &mut self, ) -> impl Future<Output = Result<i64>> + '_
where Self: Unpin,

Asynchronously reads a strict LEB128 i64.

§Returns

Returns the decoded i64.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

§Cancellation safety

This operation is not cancellation safe. Dropping the future retains any bytes already consumed from the input.

Source

fn read_sleb_i128_non_strict_async( &mut self, ) -> impl Future<Output = Result<i128>> + '_
where Self: Unpin,

Asynchronously reads a non-strict LEB128 i128.

§Returns

Returns the decoded i128.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

§Cancellation safety

This operation is not cancellation safe. Dropping the future retains any bytes already consumed from the input.

Source

fn read_sleb_i128_strict_async( &mut self, ) -> impl Future<Output = Result<i128>> + '_
where Self: Unpin,

Asynchronously reads a strict LEB128 i128.

§Returns

Returns the decoded i128.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

§Cancellation safety

This operation is not cancellation safe. Dropping the future retains any bytes already consumed from the input.

Source

fn read_sleb_isize_non_strict_async( &mut self, ) -> impl Future<Output = Result<isize>> + '_
where Self: Unpin,

Asynchronously reads a non-strict LEB128 isize.

§Returns

Returns the decoded isize.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

§Cancellation safety

This operation is not cancellation safe. Dropping the future retains any bytes already consumed from the input.

Source

fn read_sleb_isize_strict_async( &mut self, ) -> impl Future<Output = Result<isize>> + '_
where Self: Unpin,

Asynchronously reads a strict LEB128 isize.

§Returns

Returns the decoded isize.

§Errors

Returns an input error or an invalid-data error when the payload is malformed or violates the selected policy.

§Cancellation safety

This operation is not cancellation safe. Dropping the future retains any bytes already consumed from the input.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<R> AsyncLeb128ReadExt for R
where R: AsyncInput<Item = u8> + ?Sized,