/// Updates the history.
///
/// Produces a new list of address origins based on the route origins
/// and local exceptions. If this list differs from the current list
/// of address origins, adds a new version to the history.
///
/// The method returns whether it added a new version.
///
/// Note also that the method has to acquire the write lock on the
/// history.
Updates the history.
Produces a new list of address origins based on the route origins
and local exceptions. If this list differs from the current list
of address origins, adds a new version to the history.

The method returns whether it added a new version.

Note also that the method has to acquire the write lock on the
history.
Updates the history . Produces a new list of address origins based on the route origins and local exceptions . If this list differs from the current list of address origins adds a new version to the history . The method returns whether it added a new version . Note also that the method has to acquire the write lock on the history .
pub fn update(
        &self,
        origins: Option<Vec<RouteOrigins>>,
        exceptions: &LocalExceptions,
        extra_info: bool,
    ) -> bool {
        let (serial, current) = {
            let history = self.0.read().unwrap();
            let serial = history.serial().add(1);
            let current = history.current.clone();
            (serial, current)
        };
        let current: HashSet<_> = current.iter().map(Clone::clone).collect();
        let (next, diff, metrics) = OriginsDiff::construct(
            current, origins, exceptions, serial, extra_info
        );
        let mut history = self.0.write().unwrap();
        if !diff.is_empty() {
            history.current = Arc::new(next);
            history.push_diff(diff);
            history.push_metrics(metrics);
            true
        }
        else {
            false
        }
    }
pub fn update ( & self , origins : Option < Vec < RouteOrigins > > , exceptions : & LocalExceptions , extra_info : bool , ) -> bool { let ( serial , current ) = { let history = self . 0 . read ( ) . unwrap ( ) ; let serial = history . serial ( ) . add ( 1 ) ; let current = history . current . clone ( ) ; ( serial , current ) } ; let current : HashSet < _ > = current . iter ( ) . map ( Clone :: clone ) . collect ( ) ; let ( next , diff , metrics ) = OriginsDiff :: construct ( current , origins , exceptions , serial , extra_info ) ; let mut history = self . 0 . write ( ) . unwrap ( ) ; if ! diff . is_empty ( ) { history . current = Arc :: new ( next ) ; history . push_diff ( diff ) ; history . push_metrics ( metrics ) ; true } else { false } }
Updates the history.
Updates the history .
&self
origins
Option<Vec<RouteOrigins>>
exceptions
&LocalExceptions
extra_info
bool