pub fn new(root: Region) -> Result<Arc<AddressSpace>> {
        let space = Arc::new(AddressSpace {
            root: root.clone(),
            flat_view: ArcSwap::new(Arc::new(FlatView::default())),
            listeners: Arc::new(Mutex::new(Vec::new())),
            ioeventfds: Arc::new(Mutex::new(Vec::new())),
        });

        root.set_belonged_address_space(&space);
        if !space.root.subregions().is_empty() {
            space
                .update_topology()
                .chain_err(|| "Failed to update topology for address_space")?;
        }

        Ok(space)
    }
/// Create a new `AddressSpace` according to the given root region.
///
/// # Arguments
///
/// * `root` - Root region of address space.
Create a new `AddressSpace` according to the given root region.
Create a new ` AddressSpace ` according to the given root region .
pub fn new(root: Region) -> Result<Arc<AddressSpace>> {
        let space = Arc::new(AddressSpace {
            root: root.clone(),
            flat_view: ArcSwap::new(Arc::new(FlatView::default())),
            listeners: Arc::new(Mutex::new(Vec::new())),
            ioeventfds: Arc::new(Mutex::new(Vec::new())),
        });
        root.set_belonged_address_space(&space);
        if !space.root.subregions().is_empty() {
            space
                .update_topology()
                .chain_err(|| "Failed to update topology for address_space")?;
        }
        Ok(space)
    }
pub fn new ( root : Region ) -> Result < Arc < AddressSpace > > { let space = Arc :: new ( AddressSpace { root : root . clone ( ) , flat_view : ArcSwap :: new ( Arc :: new ( FlatView :: default ( ) ) ) , listeners : Arc :: new ( Mutex :: new ( Vec :: new ( ) ) ) , ioeventfds : Arc :: new ( Mutex :: new ( Vec :: new ( ) ) ) , } ) ; root . set_belonged_address_space ( & space ) ; if ! space . root . subregions ( ) . is_empty ( ) { space . update_topology ( ) . chain_err ( | | " " ) ? ; } Ok ( space ) }
Create a new `AddressSpace` according to the given root region.
Create a new ` AddressSpace ` according to the given root region .
root
Region
root
Region