[][src]Trait oso::FromPolar

pub trait FromPolar: Clone + Sized + 'static {
    fn from_polar(term: &Term, host: &Host) -> Result<Self> { ... }
}

Convert Polar types to Rust types.

This trait is automatically implemented for any type that implements the PolarClass trait, which should be preferred.

This is also implemented automatically using the #[derive(PolarClass)] macro.

Trait bounds

Currently FromPolar requires Clone because we can only get a borrowed value back from oso. In the future, this could be updated to return borrowed data instead.

FromPolar also requires types to be Send + Sync, since it is possible to store a FromPolar value on an Oso instance which can be shared between threads

FromPolar implementors must also be concrete, sized types without any borrows.

Provided methods

fn from_polar(term: &Term, host: &Host) -> Result<Self>

Loading content...

Implementors

impl<T: FromPolarValue> FromPolar for T[src]

Loading content...