Enum transit_grid::core::Accessability
source · pub enum Accessability {
ReachableNodes(Vec<NodeId>),
UnreachableNodes(Vec<NodeId>),
}Expand description
Re-export of the Accessability enum from the accessability module.
Enum Accessability representing the accessibility of nodes in a network.
This enum has two variants:
-
ReachableNodes: This variant holds a vector ofNodeIds which are reachable from a specific node. This information could be used to limit the search space during network traversal operations. -
UnreachableNodes: This variant holds a vector ofNodeIds which cannot be reached from a specific node. This information could be used to prevent the search from exploring infeasible paths during network traversal operations.
Variants
-
ReachableNodes(Vec<NodeId>): A variant holding a vector of reachable node IDs. -
UnreachableNodes(Vec<NodeId>): A variant holding a vector of unreachable node IDs.
Example
use transit_grid::core::{Accessability, NodeId};
// Define some node IDs
let nodes = vec![1, 2, 3, 4, 5];
// Define Accessability
let access = Accessability::ReachableNodes(nodes);
match access {
Accessability::ReachableNodes(ids) => {
// Process reachable nodes
}
Accessability::UnreachableNodes(ids) => {
// Process unreachable nodes
}
}Variants§
ReachableNodes(Vec<NodeId>)
A variant holding a vector of reachable node IDs.
UnreachableNodes(Vec<NodeId>)
A variant holding a vector of unreachable node IDs.
Implementations§
source§impl Accessability
impl Accessability
sourcepub fn reachable_nodes(&self) -> Option<&Vec<NodeId>>
pub fn reachable_nodes(&self) -> Option<&Vec<NodeId>>
Returns a reference to the vector of reachable nodes if the NodeAccessability instance is the ReachableNodes variant.
Returns
Option<&Vec<NodeId>> - Some reference to the vector of reachable nodes, or None if the instance is UnreachableNodes.
sourcepub fn unreachable_nodes(&self) -> Option<&Vec<NodeId>>
pub fn unreachable_nodes(&self) -> Option<&Vec<NodeId>>
Returns a reference to the vector of unreachable nodes if the NodeAccessability instance is the UnreachableNodes variant.
Returns
Option<&Vec<NodeId>> - Some reference to the vector of unreachable nodes, or None if the instance is ReachableNodes.
Trait Implementations§
source§impl Clone for Accessability
impl Clone for Accessability
source§fn clone(&self) -> Accessability
fn clone(&self) -> Accessability
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for Accessability
impl Debug for Accessability
source§impl PartialEq<Accessability> for Accessability
impl PartialEq<Accessability> for Accessability
source§fn eq(&self, other: &Accessability) -> bool
fn eq(&self, other: &Accessability) -> bool
self and other values to be equal, and is used
by ==.impl Eq for Accessability
impl StructuralEq for Accessability
impl StructuralPartialEq for Accessability
Auto Trait Implementations§
impl RefUnwindSafe for Accessability
impl Send for Accessability
impl Sync for Accessability
impl Unpin for Accessability
impl UnwindSafe for Accessability
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.