ckb_gen_types::prelude

Trait FromSliceShouldBeOk

Source
pub trait FromSliceShouldBeOk<'r>: Reader<'r> {
    // Required methods
    fn from_slice_should_be_ok(slice: &'r [u8]) -> Self;
    fn from_compatible_slice_should_be_ok(slice: &'r [u8]) -> Self;
}
Expand description

An alias of from_slice(..) to mark where we are really have confidence to do unwrap on the result of from_slice(..).

Required Methods§

Source

fn from_slice_should_be_ok(slice: &'r [u8]) -> Self

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

Source

fn from_compatible_slice_should_be_ok(slice: &'r [u8]) -> Self

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'r, R> FromSliceShouldBeOk<'r> for R
where R: Reader<'r>,