Struct ckb_types::packed::BytesReader[][src]

pub struct BytesReader<'r>(_);

Implementations

Converts self to a string slice.

Converts self to a string slice without checking that the string contains valid UTF-8.

Safety

This function is unsafe because it does not check that the bytes passed to it are valid UTF-8. If this constraint is violated, undefined behavior results, as the rest of Rust assumes that &strs are valid UTF-8.

Checks whether self is contains valid UTF-8 binary data.

Calculates the hash for raw data in Bytes.

Returns the empty hash if no data, otherwise, calculates the hash of the data and returns it.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter.

Unpack binary data into rust types.

Unpack binary data into rust types.

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

Performs the conversion.

Unwraps the result of from_slice(..) with confidence and we assume that it’s impossible to fail.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

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.