mod item¶
- module item¶
Types
- type ItemID¶
Variables
- const PREVIOUS_EPOCH: ItemID¶
The interned id of the
("meta", "previous_epoch")signal.Stateful nodes depend on it so they can’t run before their previous epoch completes; the scheduler controls when it is marked done. Every
Internerinterns it at construction, so it is always id 0.
- const TUBE_NODE: ItemID¶
“tube” - The marker that indicates the root of an epoch, Epoch((“tube”, 0))
Functions
- fn interner() -> Arc<Interner>¶
Get a read-only reference to the global python<->rust interner Acquired the RwLock only within the function call, releasing it immediately. See the top-level design docs for more details.
- fn interner_mut() -> RwLockWriteGuard<'static, Arc<Interner>>¶
Get a read/write reference to the global python<->rust interner, holding the lock.
Update the interner by getting a new mutable Arc from it:
let mut interner_slot = interner_mut(); let interner = Arc::make_mut(&mut interner_slot);
- fn resolve_or_intern_node(node_id: &str) -> ItemID¶
For use with Epoch - fast way to handle interned node_id -> int mappings We assume that most of the time we are constructing Epochs in the context of a scheduler, where all the node_ids will already be interned, so all we need to do is get a read-only view into the interner. To support random, python-like creation of Epochs, though, we automatically intern node ids that haven’t been: if there are no other references to the interner, as cheap as mutating the IndexMap. Otherwise, requires a copy.
Enums
- enum Item¶
A graph item: either a node id, or a (node id, signal name) pair.
The native representation of
noob.types.NodeID | noob.types.NodeSignal: astror a 2-tuple ofstron the python side.- Node(String)¶
- Signal(String, String)¶
Implementations
- impl Item¶
Functions
- fn is_signal(&self) -> bool¶
- fn node_id(&self) -> &str¶
The node id: itself for nodes, the node part for signals
Traits implemented
Structs and Unions
- struct Interner¶
Interns
Items to denseItemIDids shared by all sorters in a scheduler, so that all graph algorithms operate on integers rather than strings.Implementations
- impl Interner¶
Functions
- fn intern_signal(&mut self, node: &str, signal: &str) -> ItemID¶
Intern both the (node, signal) tuple and the node within it.
Traits implemented