pub struct Substrate {
pub topology: Topology,
pub roots: Roots,
}Expand description
The structural machine: what exists, and where to look to observe it.
Fields§
§topology: Topology§roots: RootsImplementations§
Source§impl Substrate
impl Substrate
Sourcepub fn discover(platform: &dyn Platform) -> Result<Substrate>
pub fn discover(platform: &dyn Platform) -> Result<Substrate>
Discover the substrate through a platform backend.
pub fn new(topology: Topology, roots: Roots) -> Substrate
Sourcepub fn rediscover(&self) -> Result<Substrate>
pub fn rediscover(&self) -> Result<Substrate>
Re-read the machine’s structure from the same roots.
Used to detect hotplug: a CPU going offline changes the entity set, and every cached row index in every consumer becomes wrong. Cheap enough to call once a second, far too expensive to call every tick.
Sourcepub fn structure(&self) -> (Vec<Entity>, Vec<Relation>)
pub fn structure(&self) -> (Vec<Entity>, Vec<Relation>)
Build the structural entity list and the static edges between them.
“Static” means constant for the lifetime of an epoch: containment, SMT siblinghood, cache membership and NUMA locality do not change while the set of online CPUs is unchanged. Sensors add further entities and edges on top of these.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Substrate
impl RefUnwindSafe for Substrate
impl Send for Substrate
impl Sync for Substrate
impl Unpin for Substrate
impl UnsafeUnpin for Substrate
impl UnwindSafe for Substrate
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