pub struct FlowNetwork { /* private fields */ }Expand description
A network oriented by flow direction.
Built from a connection graph plus ports, because direction lives on the port and connectivity lives on the relationship. Neither alone is enough.
Implementations§
Source§impl FlowNetwork
impl FlowNetwork
Sourcepub fn build(graph: &ConnectionGraph, ports: &[Port]) -> Self
pub fn build(graph: &ConnectionGraph, ports: &[Port]) -> Self
Orient a connection graph using the ports’ flow directions.
Sourcepub fn query(&self, element: EntityId, direction: Direction) -> FlowQuery
pub fn query(&self, element: EntityId, direction: Direction) -> FlowQuery
Elements reachable from element following (or opposing) flow.
Cycle-safe: a ring main revisits elements, and the visited set is what makes this terminate. Ring mains are normal topology, not corruption.
Sourcepub fn downstream_of(&self, element: EntityId) -> FlowQuery
pub fn downstream_of(&self, element: EntityId) -> FlowQuery
What this element feeds.
Sourcepub fn upstream_of(&self, element: EntityId) -> FlowQuery
pub fn upstream_of(&self, element: EntityId) -> FlowQuery
What feeds this element.
Auto Trait Implementations§
impl Freeze for FlowNetwork
impl RefUnwindSafe for FlowNetwork
impl Send for FlowNetwork
impl Sync for FlowNetwork
impl Unpin for FlowNetwork
impl UnsafeUnpin for FlowNetwork
impl UnwindSafe for FlowNetwork
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