pub struct NodeCapabilities { /* private fields */ }Expand description
Validated capability descriptor for one node.
Implementations§
Source§impl NodeCapabilities
impl NodeCapabilities
Sourcepub fn new(
node_id: NodeId,
ports: impl Into<Vec<PortCapability>>,
effects: impl Into<Vec<EffectCapability>>,
) -> Result<Self, CapabilityValidationError>
pub fn new( node_id: NodeId, ports: impl Into<Vec<PortCapability>>, effects: impl Into<Vec<EffectCapability>>, ) -> Result<Self, CapabilityValidationError>
Create a validated node capability descriptor.
§Errors
Returns an error if the descriptor repeats an effect, repeats a port-direction claim, or declares one port as both receiving and emitting.
Sourcepub fn native_passive(
node_id: NodeId,
ports: impl Into<Vec<PortCapability>>,
) -> Result<Self, CapabilityValidationError>
pub fn native_passive( node_id: NodeId, ports: impl Into<Vec<PortCapability>>, ) -> Result<Self, CapabilityValidationError>
Create a validated native descriptor with no external effects.
§Errors
Returns an error if the descriptor repeats a port-direction claim or declares one port as both receiving and emitting.
Sourcepub fn ports(&self) -> &[PortCapability]
pub fn ports(&self) -> &[PortCapability]
Port capabilities claimed by the node.
Sourcepub fn effects(&self) -> &[EffectCapability]
pub fn effects(&self) -> &[EffectCapability]
Effect capabilities claimed by the node.
Sourcepub fn allows_effect(&self, effect: EffectCapability) -> bool
pub fn allows_effect(&self, effect: EffectCapability) -> bool
Return whether this descriptor grants a specific effect capability.
Sourcepub fn allows_port(
&self,
port_id: &PortId,
direction: PortCapabilityDirection,
) -> bool
pub fn allows_port( &self, port_id: &PortId, direction: PortCapabilityDirection, ) -> bool
Return whether this descriptor grants a specific port-direction capability.
Trait Implementations§
Source§impl Clone for NodeCapabilities
impl Clone for NodeCapabilities
Source§fn clone(&self) -> NodeCapabilities
fn clone(&self) -> NodeCapabilities
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NodeCapabilities
impl Debug for NodeCapabilities
Source§impl PartialEq for NodeCapabilities
impl PartialEq for NodeCapabilities
Source§fn eq(&self, other: &NodeCapabilities) -> bool
fn eq(&self, other: &NodeCapabilities) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for NodeCapabilities
impl StructuralPartialEq for NodeCapabilities
Auto Trait Implementations§
impl Freeze for NodeCapabilities
impl RefUnwindSafe for NodeCapabilities
impl Send for NodeCapabilities
impl Sync for NodeCapabilities
impl Unpin for NodeCapabilities
impl UnsafeUnpin for NodeCapabilities
impl UnwindSafe for NodeCapabilities
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).