pub enum PolarValue {
Integer(i64),
Float(f64),
String(String),
Boolean(bool),
Map(HashMap<String, PolarValue>),
List(Vec<PolarValue>),
Variable(String),
Instance(Instance),
}Expand description
An enum of the possible value types that can be sent to/from Polar.
All variants except Instance represent types that can
be used natively in Polar.
Any other types can be wrapped using PolarValue::new_from_instance.
If the instance has a registered Class, then this can be used
from the policy too.
Variants§
Integer(i64)
Float(f64)
String(String)
Boolean(bool)
Map(HashMap<String, PolarValue>)
List(Vec<PolarValue>)
Variable(String)
Instance(Instance)
Implementations§
Source§impl PolarValue
impl PolarValue
Sourcepub fn new_from_instance<T>(instance: T) -> Self
pub fn new_from_instance<T>(instance: T) -> Self
Create a PolarValue::Instance from any type.
Trait Implementations§
Source§impl Clone for PolarValue
impl Clone for PolarValue
Source§fn clone(&self) -> PolarValue
fn clone(&self) -> PolarValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PolarValue
impl Debug for PolarValue
Source§impl FromPolar for PolarValue
impl FromPolar for PolarValue
fn from_polar(val: PolarValue) -> Result<Self>
Source§impl PartialEq for PolarValue
impl PartialEq for PolarValue
Source§impl ToPolar for PolarValue
impl ToPolar for PolarValue
Source§fn to_polar(self) -> PolarValue
fn to_polar(self) -> PolarValue
Convert this value into a Polar value.
Source§impl TryFrom<PolarValue> for String
impl TryFrom<PolarValue> for String
Source§impl TryFrom<PolarValue> for bool
impl TryFrom<PolarValue> for bool
Source§impl TryFrom<PolarValue> for f64
impl TryFrom<PolarValue> for f64
Source§impl TryFrom<PolarValue> for i16
impl TryFrom<PolarValue> for i16
Source§impl TryFrom<PolarValue> for i32
impl TryFrom<PolarValue> for i32
Source§impl TryFrom<PolarValue> for i64
impl TryFrom<PolarValue> for i64
Source§impl TryFrom<PolarValue> for i8
impl TryFrom<PolarValue> for i8
Source§impl TryFrom<PolarValue> for u16
impl TryFrom<PolarValue> for u16
Source§impl TryFrom<PolarValue> for u32
impl TryFrom<PolarValue> for u32
Auto Trait Implementations§
impl Freeze for PolarValue
impl !RefUnwindSafe for PolarValue
impl Send for PolarValue
impl Sync for PolarValue
impl Unpin for PolarValue
impl !UnwindSafe for PolarValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more