Skip to main content

TryFromInline

Trait TryFromInline 

Source
pub trait TryFromInline<'a, S: InlineEncoding>: Sized {
    type Error;

    // Required method
    fn try_from_inline(v: &'a Inline<S>) -> Result<Self, Self::Error>;
}
Expand description

A trait for converting a Inline with a specific schema type to a Rust type. This trait is implemented on the concrete Rust type.

Values are 32-byte arrays that represent data at a deserialization boundary. Conversions may fail depending on the schema and target type. Use Error = Infallible for conversions that genuinely cannot fail (e.g. ethnum::U256 from U256BE), and a real error type for narrowing conversions (e.g. u64 from U256BE).

This is the counterpart to the TryToInline trait.

See TryFromBlob for the counterpart trait for blobs.

Required Associated Types§

Source

type Error

The error type returned when the conversion fails.

Required Methods§

Source

fn try_from_inline(v: &'a Inline<S>) -> Result<Self, Self::Error>

Convert the Inline with a specific schema type to the Rust type.

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.

Implementations on Foreign Types§

Source§

impl TryFromInline<'_, ED25519RComponent> for ComponentBytes

Source§

impl TryFromInline<'_, ED25519SComponent> for ComponentBytes

Source§

impl TryFromInline<'_, F64> for f64

Source§

impl TryFromInline<'_, F256BE> for f256

Source§

impl TryFromInline<'_, F256LE> for f256

Source§

impl TryFromInline<'_, GenId> for String

Source§

impl TryFromInline<'_, GenId> for Uuid

Source§

impl TryFromInline<'_, I256BE> for i8

Source§

impl TryFromInline<'_, I256BE> for i16

Source§

impl TryFromInline<'_, I256BE> for i32

Source§

impl TryFromInline<'_, I256BE> for i64

Source§

impl TryFromInline<'_, I256BE> for i128

Source§

impl TryFromInline<'_, I256BE> for I256

Source§

impl TryFromInline<'_, I256LE> for i8

Source§

impl TryFromInline<'_, I256LE> for i16

Source§

impl TryFromInline<'_, I256LE> for i32

Source§

impl TryFromInline<'_, I256LE> for i64

Source§

impl TryFromInline<'_, I256LE> for i128

Source§

impl TryFromInline<'_, I256LE> for I256

Source§

impl TryFromInline<'_, U256BE> for u8

Source§

impl TryFromInline<'_, U256BE> for u16

Source§

impl TryFromInline<'_, U256BE> for u32

Source§

impl TryFromInline<'_, U256BE> for u64

Source§

impl TryFromInline<'_, U256BE> for u128

Source§

impl TryFromInline<'_, U256BE> for U256

Source§

impl TryFromInline<'_, U256LE> for u8

Source§

impl TryFromInline<'_, U256LE> for u16

Source§

impl TryFromInline<'_, U256LE> for u32

Source§

impl TryFromInline<'_, U256LE> for u64

Source§

impl TryFromInline<'_, U256LE> for u128

Source§

impl TryFromInline<'_, U256LE> for U256

Source§

impl TryFromInline<'_, LineLocation> for (u64, u64, u64, u64)

Source§

impl TryFromInline<'_, R256BE> for Ratio<i128>

Source§

impl TryFromInline<'_, R256LE> for Ratio<i128>

Source§

impl TryFromInline<'_, RangeInclusiveU128> for (u128, u128)

Source§

impl TryFromInline<'_, RangeInclusiveU128> for RangeInclusive<u128>

Source§

impl TryFromInline<'_, RangeU128> for (u128, u128)

Source§

impl TryFromInline<'_, RangeU128> for Range<u128>

Source§

impl TryFromInline<'_, NsDuration> for i128

Source§

impl TryFromInline<'_, NsDuration> for Duration

Source§

impl TryFromInline<'_, NsTAIInterval> for (i128, i128)

Source§

impl TryFromInline<'_, NsTAIInterval> for (Epoch, Epoch)

Source§

impl<'a> TryFromInline<'a, Boolean> for bool

Source§

impl<'a> TryFromInline<'a, ShortString> for &'a str

Source§

impl<'a> TryFromInline<'a, ShortString> for String

Source§

impl<'a, S: InlineEncoding> TryFromInline<'a, S> for ()

Source§

impl<H: HashProtocol> TryFromInline<'_, Hash<H>> for String

Implementors§