pub struct StateNode {
pub id: String,
pub label: String,
pub node_type: NodeType,
pub layer: StateLayer,
pub state: Option<String>,
pub properties: HashMap<String, Value>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
A node in the world state graph
Represents any stateful entity in MockForge, such as a persona, entity, session, or system component.
Fields§
§id: StringUnique identifier for this node
label: StringHuman-readable label
node_type: NodeTypeType of node (persona, entity, session, etc.)
layer: StateLayerLayer this node belongs to
state: Option<String>Current state value (if applicable)
properties: HashMap<String, Value>Additional properties/metadata
created_at: DateTime<Utc>Timestamp when this node was created
updated_at: DateTime<Utc>Timestamp when this node was last updated
Implementations§
Source§impl StateNode
impl StateNode
Sourcepub fn new(
id: String,
label: String,
node_type: NodeType,
layer: StateLayer,
) -> Self
pub fn new( id: String, label: String, node_type: NodeType, layer: StateLayer, ) -> Self
Create a new state node
Sourcepub fn set_property(&mut self, key: String, value: Value)
pub fn set_property(&mut self, key: String, value: Value)
Set a property on this node
Sourcepub fn get_property(&self, key: &str) -> Option<&Value>
pub fn get_property(&self, key: &str) -> Option<&Value>
Get a property from this node
Trait Implementations§
Source§impl<'de> Deserialize<'de> for StateNode
impl<'de> Deserialize<'de> for StateNode
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 Eq for StateNode
impl StructuralPartialEq for StateNode
Auto Trait Implementations§
impl Freeze for StateNode
impl RefUnwindSafe for StateNode
impl Send for StateNode
impl Sync for StateNode
impl Unpin for StateNode
impl UnwindSafe for StateNode
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.