pub struct SBStructuredData {
pub raw: SBStructuredDataRef,
}
Expand description
The value of a variable, register or expression.
Fields§
§raw: SBStructuredDataRef
The underlying raw SBStructuredDataRef
.
Implementations§
Source§impl SBStructuredData
impl SBStructuredData
pub fn clear(&self)
pub fn set_from_json(&self, stream: &SBStream) -> Result<(), SBError>
pub fn get_as_json(&self) -> Result<SBStream, SBError>
Sourcepub fn data_type(&self) -> StructuredDataType
pub fn data_type(&self) -> StructuredDataType
Return the type of data in this data structure.
Sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
Return the size (number of elements) in this data structure
if it is an array or dictionary type. For other types,
0
will be returned.
Sourcepub fn keys(&self) -> SBStringList
pub fn keys(&self) -> SBStringList
Return the keys in the structured data if this data structure is a dictionary type.
Sourcepub fn value_for_key(&self, key: &str) -> Option<SBStructuredData>
pub fn value_for_key(&self, key: &str) -> Option<SBStructuredData>
Return the value corresponding to a key if this data structure is a dictionary type.
Sourcepub fn item_at_index(&self, idx: usize) -> Option<SBStructuredData>
pub fn item_at_index(&self, idx: usize) -> Option<SBStructuredData>
Return the value corresponding to an index if this data structure is array.
Sourcepub fn integer_value(&self) -> Option<u64>
pub fn integer_value(&self) -> Option<u64>
Return the integer value if this data structure is an integer type.
Sourcepub fn float_value(&self) -> Option<f64>
pub fn float_value(&self) -> Option<f64>
Return the floating point value if this data structure is a floating type.
Sourcepub fn boolean_value(&self) -> Option<bool>
pub fn boolean_value(&self) -> Option<bool>
Return the boolean value if this data structure is a boolean type.
Sourcepub fn string_value(&self) -> Option<String>
pub fn string_value(&self) -> Option<String>
Provides the string value if this data structure is a string type.
Trait Implementations§
Source§impl Clone for SBStructuredData
impl Clone for SBStructuredData
Source§fn clone(&self) -> SBStructuredData
fn clone(&self) -> SBStructuredData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more