[][src]Struct ascesis::Context

pub struct Context { /* fields omitted */ }

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.

Methods

impl Context[src]

pub fn new_toplevel<S>(name: S) -> Arc<Mutex<Context>> where
    S: AsRef<str>, 
[src]

Creates a new toplevel Context instance and returns the corresponding ContextHandle.

Calling this method is the only public way of creating toplevel Context instances.

pub fn reset(&mut self)[src]

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.

pub fn new_derived<S>(
    name: S,
    parent: &Arc<Mutex<Context>>
) -> Arc<Mutex<Context>> where
    S: AsRef<str>, 
[src]

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 is_toplevel(&self) -> bool[src]

pub fn is_derived(&self) -> bool[src]

pub fn get_name(&self) -> &str[src]

pub fn share_node_name<S>(&mut self, node_name: S) -> NodeID where
    S: AsRef<str>, 
[src]

pub fn get_node_name(&self, node_id: NodeID) -> Option<&str>[src]

pub fn get_node_id<S>(&self, node_name: S) -> Option<NodeID> where
    S: AsRef<str>, 
[src]

pub fn is_port(&self, atom_id: NonZeroUsize) -> bool[src]

pub fn is_harc(&self, atom_id: NonZeroUsize) -> bool[src]

pub fn is_fork(&self, atom_id: NonZeroUsize) -> bool[src]

pub fn is_join(&self, atom_id: NonZeroUsize) -> bool[src]

pub fn share_port(&mut self, port: &mut Port) -> PortID[src]

pub fn share_fork(&mut self, fork: &mut Harc) -> ForkID[src]

pub fn share_join(&mut self, join: &mut Harc) -> JoinID[src]

pub fn get_port(&self, port_id: PortID) -> Option<&Port>[src]

pub fn get_harc(&self, atom_id: NonZeroUsize) -> Option<&Harc>[src]

pub fn get_fork(&self, fork_id: ForkID) -> Option<&Harc>[src]

pub fn get_join(&self, join_id: JoinID) -> Option<&Harc>[src]

pub fn get_antiport_id(&self, port_id: PortID) -> Option<PortID>[src]

pub fn add_content<S>(
    &mut self,
    name: S,
    content: PartialContent
) -> Option<PartialContent> where
    S: AsRef<str>, 
[src]

pub fn get_content<S>(&self, name: S) -> Option<&PartialContent> where
    S: AsRef<str>, 
[src]

pub fn has_content<S>(&self, name: S) -> bool where
    S: AsRef<str>, 
[src]

pub fn set_capacity_by_name<S>(
    &mut self,
    node_name: S,
    cap: Multiplicity
) -> Option<Multiplicity> where
    S: AsRef<str>, 
[src]

pub fn get_capacity(&self, node_id: NodeID) -> Multiplicity[src]

pub fn set_weight_by_name<S, I>(
    &mut self,
    face: Face,
    host_name: S,
    suit_names: I,
    weight: Multiplicity
) -> Option<Multiplicity> where
    I: IntoIterator,
    S: AsRef<str>,
    <I as IntoIterator>::Item: AsRef<str>, 
[src]

pub fn set_inhibitor_by_name<S, I>(
    &mut self,
    face: Face,
    host_name: S,
    suit_names: I
) -> Option<Multiplicity> where
    I: IntoIterator,
    S: AsRef<str>,
    <I as IntoIterator>::Item: AsRef<str>, 
[src]

pub fn get_weight(&self, atom_id: NonZeroUsize) -> Multiplicity[src]

pub fn set_encoding(&mut self, encoding: Encoding)[src]

pub fn get_encoding(&self) -> Option<Encoding>[src]

pub fn set_semantics(&mut self, semantics: Semantics)[src]

pub fn get_semantics(&self) -> Option<Semantics>[src]

pub fn set_max_steps(&mut self, max_steps: usize)[src]

pub fn get_max_steps(&self) -> Option<usize>[src]

Trait Implementations

impl Debug for Context[src]

impl Eq for Context[src]

impl PartialEq<Context> for Context[src]

impl PartialOrd<Context> for Context[src]

Auto Trait Implementations

impl RefUnwindSafe for Context

impl Send for Context

impl Sync for Context

impl Unpin for Context

impl UnwindSafe for Context

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<Reference, Outer, OuterFieldType, Inner> HasPart<Nested<Outer, Inner>> for Reference where
    Inner: Part,
    Outer: Part<PartType = Field<OuterFieldType>>,
    OuterFieldType: HasPart<Inner, RawTarget = OuterFieldType> + PartialRefTarget + ?Sized,
    Reference: HasPart<Outer> + ?Sized

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,