pub struct Context { /* private fields */ }Expand description
A representation of shared state.
This is an umbrella type which, currently, includes a collection
of Atoms, two symbol tables (one for structure names, and
another for node names), node capacities, harc weights, and
PartialContent of any c-e structure created in this Context.
For usage, see ContextHandle type, Contextual trait and
InContext struct.
Implementations§
Source§impl Context
impl Context
Sourcepub fn new_toplevel<S>(name: S) -> Arc<Mutex<Context>>
pub fn new_toplevel<S>(name: S) -> Arc<Mutex<Context>>
Creates a new toplevel Context instance and returns the
corresponding ContextHandle.
Calling this method is the only public way of creating
toplevel Context instances.
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Clears content map, capacities, weights and runtime attributes, but doesn’t destroy shared resources.
This method preserves the collection of [Atom]s, the two
symbol tables, and the Context’s own given name and group
ID.
Sourcepub fn new_derived<S>(
name: S,
parent: &Arc<Mutex<Context>>,
) -> Arc<Mutex<Context>>
pub fn new_derived<S>( name: S, parent: &Arc<Mutex<Context>>, ) -> Arc<Mutex<Context>>
Creates a new derived Context instance and returns a
corresponding ContextHandle.
Calling this method is the only public way of creating derived
Context instances.