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§
Required Methods§
Sourcefn try_from_term<T: Term>(term: T) -> Result<Self, Self::Error>
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
impl TryFromTerm for f64
f64
implements TryFromTerm
so that compatible datatypes can easily be converted to native Rust values.
type Error = ParseFloatError
fn try_from_term<T: Term>(term: T) -> Result<Self, Self::Error>
Source§impl TryFromTerm for i32
impl TryFromTerm for i32
i32
implements TryFromTerm
so that compatible datatypes can easily be converted to native Rust values.
type Error = ParseIntError
fn try_from_term<T: Term>(term: T) -> Result<Self, Self::Error>
Source§impl TryFromTerm for isize
impl TryFromTerm for isize
isize
implements TryFromTerm
so that compatible datatypes can easily be converted to native Rust values.
type Error = ParseIntError
fn try_from_term<T: Term>(term: T) -> Result<Self, Self::Error>
Source§impl TryFromTerm for usize
impl TryFromTerm for usize
usize
implements TryFromTerm
so that compatible datatypes can easily be converted to native Rust values.