Trait oso::FromPolar [−][src]
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
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.
The default implementation for PolarClass
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
Required methods
fn from_polar(val: PolarValue) -> Result<Self>
[src]
Implementations on Foreign Types
impl FromPolar for u8
[src]
fn from_polar(val: PolarValue) -> Result<Self>
[src]
impl FromPolar for i8
[src]
fn from_polar(val: PolarValue) -> Result<Self>
[src]
impl FromPolar for u16
[src]
fn from_polar(val: PolarValue) -> Result<Self>
[src]
impl FromPolar for i16
[src]
fn from_polar(val: PolarValue) -> Result<Self>
[src]
impl FromPolar for u32
[src]
fn from_polar(val: PolarValue) -> Result<Self>
[src]
impl FromPolar for i32
[src]
fn from_polar(val: PolarValue) -> Result<Self>
[src]
impl FromPolar for i64
[src]
fn from_polar(val: PolarValue) -> Result<Self>
[src]
impl FromPolar for f64
[src]
fn from_polar(val: PolarValue) -> Result<Self>
[src]
impl FromPolar for String
[src]
fn from_polar(val: PolarValue) -> Result<Self>
[src]
impl FromPolar for bool
[src]
fn from_polar(val: PolarValue) -> Result<Self>
[src]
impl<T: FromPolar> FromPolar for HashMap<String, T>
[src]
fn from_polar(val: PolarValue) -> Result<Self>
[src]
impl<T: FromPolar> FromPolar for Vec<T>
[src]
fn from_polar(val: PolarValue) -> Result<Self>
[src]
impl<T: FromPolar> FromPolar for Option<T>
[src]
fn from_polar(val: PolarValue) -> Result<Self>
[src]
Implementors
impl FromPolar for PolarValue
[src]
fn from_polar(val: PolarValue) -> Result<Self>
[src]
impl<T> FromPolar for T where
T: 'static + Clone + PolarClass,
[src]
T: 'static + Clone + PolarClass,