[−][src]Struct ascesis::Context
A representation of shared state.
This is an umbrella type which, currently, includes a collection
of Atom
s, 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]
S: AsRef<str>,
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]
name: S,
parent: &Arc<Mutex<Context>>
) -> Arc<Mutex<Context>> where
S: AsRef<str>,
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]
S: AsRef<str>,
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]
S: AsRef<str>,
pub fn is_port(&self, atom_id: NonZeroUsize) -> bool
[src]
pub fn is_link(&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_link(&mut self, link: &mut Link) -> LinkID
[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_link(&self, link_id: LinkID) -> Option<&Link>
[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]
&mut self,
name: S,
content: PartialContent
) -> Option<PartialContent> where
S: AsRef<str>,
pub fn get_content<S>(&self, name: S) -> Option<&PartialContent> where
S: AsRef<str>,
[src]
S: AsRef<str>,
pub fn has_content<S>(&self, name: S) -> bool where
S: AsRef<str>,
[src]
S: AsRef<str>,
pub fn set_capacity_by_name<S>(
&mut self,
node_name: S,
cap: Multiplicity
) -> Option<Multiplicity> where
S: AsRef<str>,
[src]
&mut self,
node_name: S,
cap: Multiplicity
) -> Option<Multiplicity> where
S: AsRef<str>,
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]
&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>,
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]
&mut self,
face: Face,
host_name: S,
suit_names: I
) -> Option<Multiplicity> where
I: IntoIterator,
S: AsRef<str>,
<I as IntoIterator>::Item: AsRef<str>,
pub fn set_holder_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]
&mut self,
face: Face,
host_name: S,
suit_names: I
) -> Option<Multiplicity> where
I: IntoIterator,
S: AsRef<str>,
<I as IntoIterator>::Item: AsRef<str>,
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_search(&mut self, search: Search)
[src]
pub fn get_search(&self) -> Option<Search>
[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]
pub fn set_title<S>(&mut self, title: S) where
S: AsRef<str>,
[src]
S: AsRef<str>,
pub fn get_title(&self) -> Option<&str>
[src]
pub fn set_label<S>(&mut self, node_id: NodeID, label: S) where
S: AsRef<str>,
[src]
S: AsRef<str>,
pub fn get_label(&self, node_id: NodeID) -> Option<&str>
[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[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,
Inner: Part,
Outer: Part<PartType = Field<OuterFieldType>>,
OuterFieldType: HasPart<Inner, RawTarget = OuterFieldType> + PartialRefTarget + ?Sized,
Reference: HasPart<Outer> + ?Sized,
unsafe fn part_ptr(
ptr: *const <Reference as PartialRefTarget>::RawTarget
) -> <<Inner as Part>::PartType as PartType>::Ptr
ptr: *const <Reference as PartialRefTarget>::RawTarget
) -> <<Inner as Part>::PartType as PartType>::Ptr
unsafe fn part_ptr_mut(
ptr: *mut <Reference as PartialRefTarget>::RawTarget
) -> <<Inner as Part>::PartType as PartType>::PtrMut
ptr: *mut <Reference as PartialRefTarget>::RawTarget
) -> <<Inner as Part>::PartType as PartType>::PtrMut
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,