pub struct ComposableNamespace {
pub namespace: Namespace,
pub interfaces: Vec<Interface>,
}Expand description
A namespace with marked interfaces for operadic composition.
Extends the basic Namespace with input/output interface markings,
enabling operadic gluing operations.
Fields§
§namespace: NamespaceThe underlying namespace
interfaces: Vec<Interface>Interfaces marked on capabilities
Implementations§
Source§impl ComposableNamespace
impl ComposableNamespace
Sourcepub fn new(namespace: Namespace) -> Self
pub fn new(namespace: Namespace) -> Self
Create a composable namespace from an existing namespace.
Sourcepub fn mark_output(&mut self, cap_id: &CapabilityId) -> Result<(), String>
pub fn mark_output(&mut self, cap_id: &CapabilityId) -> Result<(), String>
Mark a capability as an output interface.
§Contract
requires: namespace has capability with given id
ensures: interfaces contains an Output entry for cap_idSourcepub fn mark_input(&mut self, cap_id: &CapabilityId) -> Result<(), String>
pub fn mark_input(&mut self, cap_id: &CapabilityId) -> Result<(), String>
Mark a capability as an input interface.
§Contract
requires: namespace has capability with given id
ensures: interfaces contains an Input entry for cap_idSourcepub fn effective_capability_count(&self) -> usize
pub fn effective_capability_count(&self) -> usize
Effective capability count: total capabilities minus glued interfaces.
§Contract
ensures: result == self.namespace.capabilities.len() - self.interfaces.len()
(saturating at 0)Trait Implementations§
Source§impl Clone for ComposableNamespace
impl Clone for ComposableNamespace
Source§fn clone(&self) -> ComposableNamespace
fn clone(&self) -> ComposableNamespace
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ComposableNamespace
impl RefUnwindSafe for ComposableNamespace
impl Send for ComposableNamespace
impl Sync for ComposableNamespace
impl Unpin for ComposableNamespace
impl UnsafeUnpin for ComposableNamespace
impl UnwindSafe for ComposableNamespace
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more