sophia_api::term

Trait TryFromTerm

Source
pub trait TryFromTerm: Sized {
    type Error: 'static + Error;

    // Required method
    fn try_from_term<T: Term>(term: T) -> Result<Self, Self::Error>;
}
Expand description

A type that can be built from some terms.

See also FromTerm

Required Associated Types§

Source

type Error: 'static + Error

The error type produced when failing to copy a given term

Required Methods§

Source

fn try_from_term<T: Term>(term: T) -> Result<Self, Self::Error>

Try to copy term into an instance of this 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 TryFromTerm for f64

f64 implements TryFromTerm so that compatible datatypes can easily be converted to native Rust values.

Source§

type Error = ParseFloatError

Source§

fn try_from_term<T: Term>(term: T) -> Result<Self, Self::Error>

Source§

impl TryFromTerm for i32

i32 implements TryFromTerm so that compatible datatypes can easily be converted to native Rust values.

Source§

type Error = ParseIntError

Source§

fn try_from_term<T: Term>(term: T) -> Result<Self, Self::Error>

Source§

impl TryFromTerm for isize

isize implements TryFromTerm so that compatible datatypes can easily be converted to native Rust values.

Source§

type Error = ParseIntError

Source§

fn try_from_term<T: Term>(term: T) -> Result<Self, Self::Error>

Source§

impl TryFromTerm for usize

usize implements TryFromTerm so that compatible datatypes can easily be converted to native Rust values.

Source§

type Error = ParseIntError

Source§

fn try_from_term<T: Term>(term: T) -> Result<Self, Self::Error>

Implementors§