pub struct ConvergenceRecording { /* private fields */ }Expand description
Record of an entire convergence process that captures the history of each change in the forwarding state of the network. This is a record that allows the state to be moved forwards or backwards in time. The recording can be changed on a per-prefix level.
Implementations§
Source§impl ConvergenceRecording
impl ConvergenceRecording
Sourcepub fn new(
initial_fw_state: ForwardingState<SinglePrefix>,
trace: ConvergenceTrace,
) -> Self
pub fn new( initial_fw_state: ForwardingState<SinglePrefix>, trace: ConvergenceTrace, ) -> Self
Create a Recording from a trace and an initial forwarding state
Sourcepub fn state(&mut self) -> &mut ForwardingState<SinglePrefix>
pub fn state(&mut self) -> &mut ForwardingState<SinglePrefix>
Get a reference to the current forwarding state
Sourcepub fn trace(&self) -> &ConvergenceTrace
pub fn trace(&self) -> &ConvergenceTrace
Get a reference of the convergence trace.
Sourcepub fn as_trace(self) -> ConvergenceTrace
pub fn as_trace(self) -> ConvergenceTrace
Transform the recording into a trace.
Sourcepub fn step(
&mut self,
) -> Option<(&[FwDelta], Option<f64>, &mut ForwardingState<SinglePrefix>)>
pub fn step( &mut self, ) -> Option<(&[FwDelta], Option<f64>, &mut ForwardingState<SinglePrefix>)>
Perform a single step for an individual prefix. If the forwarding state is already in the
final state for the specifiied prefix, then this function will return None. Otherwise, it
will return a slice containing all deltas that were applied during this function call, the
network’s convergence time when the change took effect (if applicable), and a mutable
reference to the new ForwardingState.
Sourcepub fn back(
&mut self,
) -> Option<(&[FwDelta], Option<f64>, &mut ForwardingState<SinglePrefix>)>
pub fn back( &mut self, ) -> Option<(&[FwDelta], Option<f64>, &mut ForwardingState<SinglePrefix>)>
Undo a single step for an individual prefix. If the forwarding state is already in the
initial state for the specifiied prefix, then this function will return None. Otherwise, it
will return a slice containing all deltas that were applied in reverse direction during
this function call, the network’s convergence time when the change took effect (if
applicable), and a mutable reference to the new ForwardingState.
Sourcepub fn into_initial_fw_state(self) -> ForwardingState<SinglePrefix>
pub fn into_initial_fw_state(self) -> ForwardingState<SinglePrefix>
Reverts to and releases the initial ForwardingState held by self, while consuming
self. This function will also drop any timing information.
Trait Implementations§
Source§impl Clone for ConvergenceRecording
impl Clone for ConvergenceRecording
Source§fn clone(&self) -> ConvergenceRecording
fn clone(&self) -> ConvergenceRecording
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConvergenceRecording
impl Debug for ConvergenceRecording
Source§impl<'n, P: Prefix, Q, Ospf: OspfImpl> NetworkFormatter<'n, P, Q, Ospf> for ConvergenceRecording
impl<'n, P: Prefix, Q, Ospf: OspfImpl> NetworkFormatter<'n, P, Q, Ospf> for ConvergenceRecording
Source§impl PartialEq for ConvergenceRecording
impl PartialEq for ConvergenceRecording
impl StructuralPartialEq for ConvergenceRecording
Auto Trait Implementations§
impl Freeze for ConvergenceRecording
impl RefUnwindSafe for ConvergenceRecording
impl Send for ConvergenceRecording
impl Sync for ConvergenceRecording
impl Unpin for ConvergenceRecording
impl UnwindSafe for ConvergenceRecording
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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