pub fn new_derived<S: AsRef<str>>(name: S, parent: &ContextHandle) -> ContextHandle {
        let ctx = {
            let mut parent = parent.lock().unwrap();

            let magic_id = parent.magic_id;

            // NameId of child name in parent and child is the same
            // (but not in further ancestors).  See `partial_cmp`.
            let name_id = parent.globals.share_name(name);

            let globals = parent.globals.clone();
            let dots = parent.dots.clone();
            let atoms = parent.atoms.clone();
            let content = parent.content.clone();
            let capacities = parent.capacities.clone();
            let core_weights = parent.core_weights.clone();
            let wedge_weights = parent.wedge_weights.clone();
            let solver_props = parent.solver_props.clone();
            let runner_props = parent.runner_props.clone();
            let vis_props = parent.vis_props.clone();

            Self {
                magic_id,
                name_id,
                globals,
                dots,
                atoms,
                content,
                capacities,
                core_weights,
                wedge_weights,
                solver_props,
                runner_props,
                vis_props,
            }
        };

        Arc::new(Mutex::new(ctx))
    }
/// Creates a new derived `Context` instance and returns a
/// corresponding [`ContextHandle`].
///
/// Calling this method is the only public way of creating derived
/// `Context` instances.
Creates a new derived `Context` instance and returns a
corresponding [`ContextHandle`].

Calling this method is the only public way of creating derived
`Context` instances.
Creates a new derived ` Context ` instance and returns a corresponding [ ` ContextHandle ` ] . Calling this method is the only public way of creating derived ` Context ` instances .
pub fn new_derived<S: AsRef<str>>(name: S, parent: &ContextHandle) -> ContextHandle {
        let ctx = {
            let mut parent = parent.lock().unwrap();
            let magic_id = parent.magic_id;
            // NameId of child name in parent and child is the same
            // (but not in further ancestors).  See `partial_cmp`.
            let name_id = parent.globals.share_name(name);
            let globals = parent.globals.clone();
            let dots = parent.dots.clone();
            let atoms = parent.atoms.clone();
            let content = parent.content.clone();
            let capacities = parent.capacities.clone();
            let core_weights = parent.core_weights.clone();
            let wedge_weights = parent.wedge_weights.clone();
            let solver_props = parent.solver_props.clone();
            let runner_props = parent.runner_props.clone();
            let vis_props = parent.vis_props.clone();
            Self {
                magic_id,
                name_id,
                globals,
                dots,
                atoms,
                content,
                capacities,
                core_weights,
                wedge_weights,
                solver_props,
                runner_props,
                vis_props,
            }
        };
        Arc::new(Mutex::new(ctx))
    }
pub fn new_derived < S : AsRef < str > > ( name : S , parent : & ContextHandle ) -> ContextHandle { let ctx = { let mut parent = parent . lock ( ) . unwrap ( ) ; let magic_id = parent . magic_id ; // NameId of child name in parent and child is the same // (but not in further ancestors).  See `partial_cmp`. let name_id = parent . globals . share_name ( name ) ; let globals = parent . globals . clone ( ) ; let dots = parent . dots . clone ( ) ; let atoms = parent . atoms . clone ( ) ; let content = parent . content . clone ( ) ; let capacities = parent . capacities . clone ( ) ; let core_weights = parent . core_weights . clone ( ) ; let wedge_weights = parent . wedge_weights . clone ( ) ; let solver_props = parent . solver_props . clone ( ) ; let runner_props = parent . runner_props . clone ( ) ; let vis_props = parent . vis_props . clone ( ) ; Self { magic_id , name_id , globals , dots , atoms , content , capacities , core_weights , wedge_weights , solver_props , runner_props , vis_props , } } ; Arc :: new ( Mutex :: new ( ctx ) ) }
Creates a new derived `Context` instance and returns a
corresponding [`ContextHandle`].
Creates a new derived ` Context ` instance and returns a corresponding [ ` ContextHandle ` ] .
name
S
parent
&ContextHandle
name
S
parent
&ContextHandle