Trait artichoke::prelude::TryConvert[][src]

pub trait TryConvert<T, U> {
    type Error;
    fn try_convert(&self, value: T) -> Result<U, Self::Error>;
}

Fallible conversions between two types.

Implementors may not allocate on the interpreter heap.

See core::convert::TryFrom. See TryConvertMut.

Associated Types

type Error[src]

Error type for failed conversions.

Loading content...

Required methods

fn try_convert(&self, value: T) -> Result<U, Self::Error>[src]

Performs the fallible conversion.

Errors

If boxing or unboxing a value into the specified type fails, an error is returned.

Loading content...

Implementors

impl TryConvert<isize, Value> for Artichoke[src]

type Error = Error

pub fn try_convert(
    &self,
    value: isize
) -> Result<Value, <Artichoke as TryConvert<isize, Value>>::Error>
[src]

impl TryConvert<u64, Value> for Artichoke[src]

type Error = Error

pub fn try_convert(
    &self,
    value: u64
) -> Result<Value, <Artichoke as TryConvert<u64, Value>>::Error>
[src]

impl TryConvert<usize, Value> for Artichoke[src]

type Error = Error

pub fn try_convert(
    &self,
    value: usize
) -> Result<Value, <Artichoke as TryConvert<usize, Value>>::Error>
[src]

impl TryConvert<Value, Option<bool>> for Artichoke[src]

type Error = Error

pub fn try_convert(
    &self,
    value: Value
) -> Result<Option<bool>, <Artichoke as TryConvert<Value, Option<bool>>>::Error>
[src]

impl TryConvert<Value, Option<i64>> for Artichoke[src]

type Error = Error

pub fn try_convert(
    &self,
    value: Value
) -> Result<Option<i64>, <Artichoke as TryConvert<Value, Option<i64>>>::Error>
[src]

impl TryConvert<Value, bool> for Artichoke[src]

type Error = Error

pub fn try_convert(
    &self,
    value: Value
) -> Result<bool, <Artichoke as TryConvert<Value, bool>>::Error>
[src]

impl TryConvert<Value, f64> for Artichoke[src]

type Error = Error

pub fn try_convert(
    &self,
    value: Value
) -> Result<f64, <Artichoke as TryConvert<Value, f64>>::Error>
[src]

impl TryConvert<Value, i64> for Artichoke[src]

type Error = Error

pub fn try_convert(
    &self,
    value: Value
) -> Result<i64, <Artichoke as TryConvert<Value, i64>>::Error>
[src]

impl TryConvert<Value, u32> for Artichoke[src]

type Error = Error

pub fn try_convert(
    &self,
    value: Value
) -> Result<u32, <Artichoke as TryConvert<Value, u32>>::Error>
[src]

impl TryConvert<Value, usize> for Artichoke[src]

type Error = Error

pub fn try_convert(
    &self,
    value: Value
) -> Result<usize, <Artichoke as TryConvert<Value, usize>>::Error>
[src]

impl TryConvert<Value, Float> for Artichoke[src]

type Error = Error

pub fn try_convert(
    &self,
    value: Value
) -> Result<Float, <Artichoke as TryConvert<Value, Float>>::Error>
[src]

impl TryConvert<Value, Integer> for Artichoke[src]

type Error = Error

pub fn try_convert(
    &self,
    value: Value
) -> Result<Integer, <Artichoke as TryConvert<Value, Integer>>::Error>
[src]

impl<T, U> TryConvert<T, U> for Artichoke where
    Artichoke: Convert<T, U>, 
[src]

Provide a fallible converter for types that implement an infallible conversion.

pub fn try_convert(
    &self,
    value: T
) -> Result<U, <Artichoke as TryConvert<T, U>>::Error>
[src]

Blanket implementation that always succeeds by delegating to Convert::convert.

type Error = Error

Loading content...