[][src]Trait oso::ToPolar

pub trait ToPolar: Send + Sync + Sized + 'static {
    fn to_polar_value(self, host: &mut Host) -> Value { ... }
fn to_polar(self, host: &mut Host) -> Term { ... } }

Convert Rust types to Polar types.

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

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

For non-primitive types, the instance will be stored on the provided Host.

Trait bounds

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

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

Provided methods

fn to_polar_value(self, host: &mut Host) -> Value

fn to_polar(self, host: &mut Host) -> Term

Loading content...

Implementations on Foreign Types

impl ToPolar for bool[src]

impl ToPolar for u8[src]

impl ToPolar for i8[src]

impl ToPolar for u16[src]

impl ToPolar for i16[src]

impl ToPolar for u32[src]

impl ToPolar for i32[src]

impl ToPolar for i64[src]

impl ToPolar for f32[src]

impl ToPolar for f64[src]

impl ToPolar for String[src]

impl ToPolar for &'static str[src]

impl<T: ToPolar> ToPolar for Vec<T>[src]

impl<T: ToPolar> ToPolar for HashMap<String, T>[src]

impl ToPolar for Value[src]

Loading content...

Implementors

impl ToPolar for PolarValue[src]

impl ToPolar for Class[src]

impl<C: PolarClass + Send + Sync> ToPolar for C[src]

Loading content...