Trait oso::ToPolar [−][src]
pub trait ToPolar {
fn to_polar(self) -> PolarValue;
}
Expand description
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
The default implementation for PolarClass
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.