Enum specifications::common::Value
source · pub enum Value {
Array {
data_type: String,
entries: Vec<Value>,
},
Boolean(bool),
Integer(i64),
Pointer {
data_type: String,
variable: String,
secret: bool,
},
Real(f64),
Struct {
data_type: String,
properties: HashMap<String, Value>,
},
Unicode(String),
Unit,
Class(SpecClass),
Function(SpecFunction),
FunctionExt(FunctionExt),
}
Expand description
Defines a value of some sort, which can be of multiple types.
Variants§
Array
Boolean(bool)
Integer(i64)
Pointer
Real(f64)
Struct
Unicode(String)
Unit
Class(SpecClass)
Function(SpecFunction)
FunctionExt(FunctionExt)
Implementations§
source§impl Value
impl Value
pub fn from_json(value: &JValue) -> Self
sourcepub fn data_type(&self) -> String
pub fn data_type(&self) -> String
Edited: Changed return type to String instead of &str.
Returns a string representation of the Value’s type.
pub fn as_bool(&self) -> Result<bool, CastError>
pub fn as_f64(&self) -> Result<f64, CastError>
pub fn as_i64(&self) -> Result<i64, CastError>
pub fn as_string(&self) -> Result<String, CastError>
pub fn as_json(&self) -> JValue
Trait Implementations§
source§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<SpecFunction> for Value
impl From<SpecFunction> for Value
source§fn from(function: SpecFunction) -> Self
fn from(function: SpecFunction) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request