pub struct AgentData {
pub kind: String,
pub value: AgentValue,
}Fields§
§kind: String§value: AgentValueImplementations§
Source§impl AgentData
impl AgentData
pub fn new_unit() -> Self
pub fn new_boolean(value: bool) -> Self
pub fn new_integer(value: i64) -> Self
pub fn new_number(value: f64) -> Self
pub fn new_string(value: impl Into<String>) -> Self
pub fn new_text(value: impl Into<String>) -> Self
pub fn new_object(value: AgentValueMap<String, AgentValue>) -> Self
pub fn new_custom_object( kind: impl Into<String>, value: AgentValueMap<String, AgentValue>, ) -> Self
pub fn new_array(kind: impl Into<String>, value: Vec<AgentValue>) -> Self
pub fn from_value(value: AgentValue) -> Self
pub fn from_json_data( kind: impl Into<String>, value: Value, ) -> Result<Self, AgentError>
pub fn from_json_value(json_value: Value) -> Result<Self, AgentError>
pub fn is_unit(&self) -> bool
pub fn is_boolean(&self) -> bool
pub fn is_integer(&self) -> bool
pub fn is_number(&self) -> bool
pub fn is_string(&self) -> bool
pub fn is_text(&self) -> bool
pub fn is_object(&self) -> bool
pub fn is_array(&self) -> bool
pub fn as_bool(&self) -> Option<bool>
pub fn as_i64(&self) -> Option<i64>
pub fn as_f64(&self) -> Option<f64>
pub fn as_str(&self) -> Option<&str>
pub fn as_object(&self) -> Option<&AgentValueMap<String, AgentValue>>
pub fn as_array(&self) -> Option<&Vec<AgentValue>>
pub fn get(&self, key: &str) -> Option<&AgentValue>
pub fn get_bool(&self, key: &str) -> Option<bool>
pub fn get_i64(&self, key: &str) -> Option<i64>
pub fn get_f64(&self, key: &str) -> Option<f64>
pub fn get_str(&self, key: &str) -> Option<&str>
pub fn get_object( &self, key: &str, ) -> Option<&AgentValueMap<String, AgentValue>>
pub fn get_array(&self, key: &str) -> Option<&Vec<AgentValue>>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AgentData
impl<'de> Deserialize<'de> for AgentData
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
impl StructuralPartialEq for AgentData
Auto Trait Implementations§
impl Freeze for AgentData
impl RefUnwindSafe for AgentData
impl Send for AgentData
impl Sync for AgentData
impl Unpin for AgentData
impl UnwindSafe for AgentData
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