MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / lift_constraint

Function lift_constraint

atomic-canonical/src/lift.rs:199–208  ·  view source on GitHub ↗

Lift a `:::constraint` container into a `Constraint`.

(d: &Directive, human_key: &str, n: usize)

Source from the content-addressed store, hash-verified

197
198/// Lift a `:::constraint` container into a `Constraint`.
199fn lift_constraint(d: &Directive, human_key: &str, n: usize) -> Constraint {
200 let local =
201 d.id.clone()
202 .unwrap_or_else(|| format!("{}-constraint-{n}", slug(human_key)));
203 Constraint {
204 type_: NodeType::Constraint.as_str().to_string(),
205 id: as_urn("constraint", &local),
206 text: d.body.clone(),
207 }
208}
209
210/// Lift a `:::ref{to= edge=}` leaf into a typed dependency edge. Both `to` and
211/// `edge` are required (a dependency with no target or no edge type is a lift

Callers 1

lift_intentFunction · 0.85

Calls 3

as_urnFunction · 0.85
cloneMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected