pub struct ReadCursor<'b> { /* private fields */ }
Expand description

A cursor over a byte slice for easy deserializing of UAVCAN data types

Functions that read values will return zero when reading beyond the end of the bytes, in accordance with the implicit zero extension rule (specification section 3.7.1.5)

Implementations

Creates a cursor that will read starting at the beginning of the provided slice

If this cursor is aligned to a byte boundary, this function returns the slice of bytes that remain to be read.

Caution: This function bypasses the normal mechanism for keeping track of which bytes have already been read. If you consume any of the returned bytes, you must call advance_bytes() so that they will not be read again alter.

Reads an 8-bit integer

Panics

This function panics if the cursor is not aligned to a multiple of 8 bits.

Reads a 16-bit integer

Panics

This function panics if the cursor is not aligned to a multiple of 8 bits.

Reads a 32-bit integer

Panics

This function panics if the cursor is not aligned to a multiple of 8 bits.

Reads a 64-bit integer

Panics

This function panics if the cursor is not aligned to a multiple of 8 bits.

Marks some bytes has having already been read

This function should only be used with as_bytes() when manually handling bytes.

Skips up to 7 bits so that this cursor is aligned to 8 bits (one byte)

Returns true if this cursor is aligned to a multiple of 8 bits

Reads a 16-bit floating-point value

Reads a 16-bit floating-point value

Panics

This function panics if the cursor is not aligned to a multiple of 8 bits.

Reads a 32-bit floating-point value

Reads a 32-bit floating-point value

Panics

This function panics if the cursor is not aligned to a multiple of 8 bits.

Reads a 64-bit floating-point value

Reads a 64-bit floating-point value

Panics

This function panics if the cursor is not aligned to a multiple of 8 bits.

Reads a byte array

Reads a composite object

This function returns an error if T is delimited and the delimiter header has an invalid length.

It also return an error if T’s deserialize implementation encounters an error.

Reads a boolean value (1 bit)

Reads a 1-bit unsigned integer

Reads a 2-bit unsigned integer

Reads a 3-bit unsigned integer

Reads a 4-bit unsigned integer

Reads a 5-bit unsigned integer

Reads a 6-bit unsigned integer

Reads a 7-bit unsigned integer

Reads a 8-bit unsigned integer

Reads a 9-bit unsigned integer

Reads a 10-bit unsigned integer

Reads a 11-bit unsigned integer

Reads a 12-bit unsigned integer

Reads a 13-bit unsigned integer

Reads a 14-bit unsigned integer

Reads a 15-bit unsigned integer

Reads a 16-bit unsigned integer

Reads a 17-bit unsigned integer

Reads a 18-bit unsigned integer

Reads a 19-bit unsigned integer

Reads a 20-bit unsigned integer

Reads a 21-bit unsigned integer

Reads a 22-bit unsigned integer

Reads a 23-bit unsigned integer

Reads a 24-bit unsigned integer

Reads a 25-bit unsigned integer

Reads a 26-bit unsigned integer

Reads a 27-bit unsigned integer

Reads a 28-bit unsigned integer

Reads a 29-bit unsigned integer

Reads a 30-bit unsigned integer

Reads a 31-bit unsigned integer

Reads a 32-bit unsigned integer

Reads a 33-bit unsigned integer

Reads a 34-bit unsigned integer

Reads a 35-bit unsigned integer

Reads a 36-bit unsigned integer

Reads a 37-bit unsigned integer

Reads a 38-bit unsigned integer

Reads a 39-bit unsigned integer

Reads a 40-bit unsigned integer

Reads a 41-bit unsigned integer

Reads a 42-bit unsigned integer

Reads a 43-bit unsigned integer

Reads a 44-bit unsigned integer

Reads a 45-bit unsigned integer

Reads a 46-bit unsigned integer

Reads a 47-bit unsigned integer

Reads a 48-bit unsigned integer

Reads a 49-bit unsigned integer

Reads a 50-bit unsigned integer

Reads a 51-bit unsigned integer

Reads a 52-bit unsigned integer

Reads a 53-bit unsigned integer

Reads a 54-bit unsigned integer

Reads a 55-bit unsigned integer

Reads a 56-bit unsigned integer

Reads a 57-bit unsigned integer

Reads a 58-bit unsigned integer

Reads a 59-bit unsigned integer

Reads a 60-bit unsigned integer

Reads a 61-bit unsigned integer

Reads a 62-bit unsigned integer

Reads a 63-bit unsigned integer

Reads a 64-bit unsigned integer

Advances the cursor to skip 1 bit

Advances the cursor to skip 2 bits

Advances the cursor to skip 3 bits

Advances the cursor to skip 4 bits

Advances the cursor to skip 5 bits

Advances the cursor to skip 6 bits

Advances the cursor to skip 7 bits

Advances the cursor to skip 8 bits

Advances the cursor to skip 9 bits

Advances the cursor to skip 10 bits

Advances the cursor to skip 11 bits

Advances the cursor to skip 12 bits

Advances the cursor to skip 13 bits

Advances the cursor to skip 14 bits

Advances the cursor to skip 15 bits

Advances the cursor to skip 16 bits

Advances the cursor to skip 17 bits

Advances the cursor to skip 18 bits

Advances the cursor to skip 19 bits

Advances the cursor to skip 20 bits

Advances the cursor to skip 21 bits

Advances the cursor to skip 22 bits

Advances the cursor to skip 23 bits

Advances the cursor to skip 24 bits

Advances the cursor to skip 25 bits

Advances the cursor to skip 26 bits

Advances the cursor to skip 27 bits

Advances the cursor to skip 28 bits

Advances the cursor to skip 29 bits

Advances the cursor to skip 30 bits

Advances the cursor to skip 31 bits

Advances the cursor to skip 32 bits

Advances the cursor to skip 33 bits

Advances the cursor to skip 34 bits

Advances the cursor to skip 35 bits

Advances the cursor to skip 36 bits

Advances the cursor to skip 37 bits

Advances the cursor to skip 38 bits

Advances the cursor to skip 39 bits

Advances the cursor to skip 40 bits

Advances the cursor to skip 41 bits

Advances the cursor to skip 42 bits

Advances the cursor to skip 43 bits

Advances the cursor to skip 44 bits

Advances the cursor to skip 45 bits

Advances the cursor to skip 46 bits

Advances the cursor to skip 47 bits

Advances the cursor to skip 48 bits

Advances the cursor to skip 49 bits

Advances the cursor to skip 50 bits

Advances the cursor to skip 51 bits

Advances the cursor to skip 52 bits

Advances the cursor to skip 53 bits

Advances the cursor to skip 54 bits

Advances the cursor to skip 55 bits

Advances the cursor to skip 56 bits

Advances the cursor to skip 57 bits

Advances the cursor to skip 58 bits

Advances the cursor to skip 59 bits

Advances the cursor to skip 60 bits

Advances the cursor to skip 61 bits

Advances the cursor to skip 62 bits

Advances the cursor to skip 63 bits

Advances the cursor to skip 64 bits

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.