pub struct NodeGraph {
nodes: BTreeMap<NodeId, InterconnectNode>,
}
Fields§
§nodes: BTreeMap<NodeId, InterconnectNode>
Flattened graph. Each node maintains a list of incoming edges from other nodes.
Implementations§
Source§impl NodeGraph
impl NodeGraph
pub fn new(nodes: Vec<Node>, edges: Vec<Edge>) -> Result<Self, Status>
Sourcepub fn update_path(
&mut self,
path: &Path,
average_bandwidth_bps: u64,
peak_bandwidth_bps: u64,
)
pub fn update_path( &mut self, path: &Path, average_bandwidth_bps: u64, peak_bandwidth_bps: u64, )
Sets the edge from |dst_node_id| to |src_node_id| to the provided bandwidth values.
Sourcepub fn make_bandwidth_requests(&self, path: &Path) -> Vec<NodeBandwidth>
pub fn make_bandwidth_requests(&self, path: &Path) -> Vec<NodeBandwidth>
Creates a bandwidth request for the specified path where the bandwidth request includes an entry for each path that intersects with this node.
Trait Implementations§
impl Eq for NodeGraph
impl StructuralPartialEq for NodeGraph
Auto Trait Implementations§
impl Freeze for NodeGraph
impl RefUnwindSafe for NodeGraph
impl Send for NodeGraph
impl Sync for NodeGraph
impl Unpin for NodeGraph
impl UnwindSafe for NodeGraph
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
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> IntoAny for T
impl<T> IntoAny for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more