pub trait PortList<S>: Variadic + Sealed<S>where
S: Polarity,{
type Ctx<'a>: Variadic;
// Required methods
fn set_graph_meta(
&self,
handoffs: &mut SlotVec<HandoffTag, HandoffData>,
out_handoff_ids: &mut Vec<HandoffId>,
sg_id: SubgraphId,
handoffs_are_preds: bool,
);
unsafe fn make_ctx<'a>(
&self,
handoffs: &'a SlotVec<HandoffTag, HandoffData>,
) -> Self::Ctx<'a>;
fn assert_is_from(&self, handoffs: &SlotVec<HandoffTag, HandoffData>);
}Expand description
Sealed trait for variadic lists of ports.
See the [variadics] crate for the strategy we use to implement variadics in Rust.
Required Associated Types§
Sourcetype Ctx<'a>: Variadic
type Ctx<'a>: Variadic
The [Variadic] return type of Self::make_ctx.
Required Methods§
Sourcefn set_graph_meta(
&self,
handoffs: &mut SlotVec<HandoffTag, HandoffData>,
out_handoff_ids: &mut Vec<HandoffId>,
sg_id: SubgraphId,
handoffs_are_preds: bool,
)
fn set_graph_meta( &self, handoffs: &mut SlotVec<HandoffTag, HandoffData>, out_handoff_ids: &mut Vec<HandoffId>, sg_id: SubgraphId, handoffs_are_preds: bool, )
Iteratively/recursively set the graph metadata for each port in this list.
Specifically sets:
HandoffData::predsandHandoffData::succsin thehandoffsslice for the handoffs in thisPortList(usingpredand/orsucc).out_handoff_idswill be extended with all the handoff IDs in thisPortList.
handoffs_are_preds:
true: Handoffs are predecessors (inputs) to subgraphsg_id.false: Handoffs are successors (outputs) from subgraphsg_id.
Sourceunsafe fn make_ctx<'a>(
&self,
handoffs: &'a SlotVec<HandoffTag, HandoffData>,
) -> Self::Ctx<'a>
unsafe fn make_ctx<'a>( &self, handoffs: &'a SlotVec<HandoffTag, HandoffData>, ) -> Self::Ctx<'a>
Iteratively/recursively construct a Ctx variadic list.
(Note that unlike Self::set_graph_meta, this does not mess with pred/succ handoffs for
teeing).
§Safety
The handoffs in this port list (self) must come from the handoffs SlotVec.
This ensure the types will match.
Use Self::assert_is_from to check this.
Sourcefn assert_is_from(&self, handoffs: &SlotVec<HandoffTag, HandoffData>)
fn assert_is_from(&self, handoffs: &SlotVec<HandoffTag, HandoffData>)
Asserts that self is a valid port list from handoffs. Panics if not.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.