Enum oso::PolarValue
source · [−]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
sourceimpl PolarValue
impl PolarValue
sourcepub fn new_from_instance<T>(instance: T) -> Self where
T: Send + Sync + 'static,
pub fn new_from_instance<T>(instance: T) -> Self where
T: Send + Sync + 'static,
Create a PolarValue::Instance
from any type.
Trait Implementations
sourceimpl Clone for PolarValue
impl Clone for PolarValue
sourcefn clone(&self) -> PolarValue
fn clone(&self) -> PolarValue
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for PolarValue
impl Debug for PolarValue
sourceimpl FromPolar for PolarValue
impl FromPolar for PolarValue
fn from_polar(val: PolarValue) -> Result<Self>
sourceimpl PartialEq<PolarValue> for PolarValue
impl PartialEq<PolarValue> for PolarValue
sourceimpl ToPolar for PolarValue
impl ToPolar for PolarValue
fn to_polar(self) -> PolarValue
sourceimpl TryFrom<PolarValue> for u8
impl TryFrom<PolarValue> for u8
sourceimpl TryFrom<PolarValue> for i8
impl TryFrom<PolarValue> for i8
sourceimpl<T: FromPolar> TryFrom<PolarValue> for Vec<T>
impl<T: FromPolar> TryFrom<PolarValue> for Vec<T>
sourceimpl TryFrom<PolarValue> for u16
impl TryFrom<PolarValue> for u16
sourceimpl TryFrom<PolarValue> for i16
impl TryFrom<PolarValue> for i16
sourceimpl TryFrom<PolarValue> for u32
impl TryFrom<PolarValue> for u32
sourceimpl TryFrom<PolarValue> for i32
impl TryFrom<PolarValue> for i32
sourceimpl TryFrom<PolarValue> for i64
impl TryFrom<PolarValue> for i64
sourceimpl TryFrom<PolarValue> for f64
impl TryFrom<PolarValue> for f64
sourceimpl TryFrom<PolarValue> for String
impl TryFrom<PolarValue> for String
Auto Trait Implementations
impl !RefUnwindSafe for PolarValue
impl Send for PolarValue
impl Sync for PolarValue
impl Unpin for PolarValue
impl !UnwindSafe for PolarValue
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more