pub struct WorkNode {
pub node_id: String,
pub generation: u32,
pub goal: String,
pub node_class: NodeClass,
pub owner_domains: Vec<String>,
pub output_targets: Vec<String>,
pub required_sensors: Vec<String>,
pub state: WorkNodeState,
}Expand description
An immutable incarnation of a node (PSP-8 WorkNode).
Fields§
§node_id: String§generation: u32§goal: String§node_class: NodeClass§owner_domains: Vec<String>§output_targets: Vec<String>§required_sensors: Vec<String>Required sensors that gate readiness (mapped from BlocksOnSensor).
state: WorkNodeStateImplementations§
Source§impl WorkNode
impl WorkNode
pub fn new( node_id: impl Into<String>, goal: impl Into<String>, node_class: NodeClass, ) -> Self
pub fn with_outputs(self, outputs: Vec<String>) -> Self
Sourcepub fn next_generation(&self) -> Self
pub fn next_generation(&self) -> Self
Create the next generation of this node, resetting it to pending.
pub fn is_terminal(&self) -> bool
pub fn is_accepted(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for WorkNode
impl<'de> Deserialize<'de> for WorkNode
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 WorkNode
Auto Trait Implementations§
impl Freeze for WorkNode
impl RefUnwindSafe for WorkNode
impl Send for WorkNode
impl Sync for WorkNode
impl Unpin for WorkNode
impl UnsafeUnpin for WorkNode
impl UnwindSafe for WorkNode
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.