Skip to main content

Module pull

Module pull 

Source
Expand description

A typesafe, builder-patterned Pull specification.

A Pull is an immutable value that lowers to the boundary Edn pull pattern the engine understands: attribute selections, *, :db/id, reverse refs, nested sub-patterns, bounded/unbounded recursion, and the :as/:limit/:default options.

use corium_client::pull::{Pull, Attr};

// [:person/name {:person/friends [:person/name]} :person/_manager]
let spec = Pull::new()
    .attr("person/name")
    .nested("person/friends", Pull::new().attr("person/name"))
    .reverse("person/manager");

Structsยง

Attr
One attribute selection with optional :as, :limit, and :default options. Forward by default; Attr::reverse flips it to a reverse ref.
Pull
An immutable Pull specification. Build it up with the fluent methods and render with Pull::to_edn.