pub fn register_listener(&self, listener: Box<dyn Listener>) -> Result<()> {
        for fr in self.flat_view.load().0.iter() {
            listener.handle_request(Some(&fr), None, ListenerReqType::AddRegion)?;
        }

        let mut idx = 0;
        let mut mls = self.listeners.lock().unwrap();
        while idx < mls.len() {
            let ml = mls.get(idx).unwrap();
            if ml.priority() >= listener.priority() {
                break;
            }
            idx += 1;
        }
        mls.insert(idx, listener);
        Ok(())
    }
/// Register the listener to the `AddressSpace`.
///
/// # Arguments
///
/// * `listener` - Provided Listener trait object.
///
/// # Errors
///
/// Return Error if fail to call `listener`.
Register the listener to the `AddressSpace`.
Register the listener to the ` AddressSpace ` .
pub fn register_listener(&self, listener: Box<dyn Listener>) -> Result<()> {
        for fr in self.flat_view.load().0.iter() {
            listener.handle_request(Some(&fr), None, ListenerReqType::AddRegion)?;
        }
        let mut idx = 0;
        let mut mls = self.listeners.lock().unwrap();
        while idx < mls.len() {
            let ml = mls.get(idx).unwrap();
            if ml.priority() >= listener.priority() {
                break;
            }
            idx += 1;
        }
        mls.insert(idx, listener);
        Ok(())
    }
pub fn register_listener ( & self , listener : Box < dyn Listener > ) -> Result < ( ) > { for fr in self . flat_view . load ( ) . 0 . iter ( ) { listener . handle_request ( Some ( & fr ) , None , ListenerReqType :: AddRegion ) ? ; } let mut idx = 0 ; let mut mls = self . listeners . lock ( ) . unwrap ( ) ; while idx < mls . len ( ) { let ml = mls . get ( idx ) . unwrap ( ) ; if ml . priority ( ) >= listener . priority ( ) { break ; } idx += 1 ; } mls . insert ( idx , listener ) ; Ok ( ( ) ) }
Register the listener to the `AddressSpace`.
Register the listener to the ` AddressSpace ` .
&self
listener
Box<dyn Listener>
&self
listener
Box<dyn Listener>
errors
Return Error if fail to call `listener`.
Return Error if fail to call ` listener ` .