pub struct ElementBuilder { /* private fields */ }Expand description
Fluent builder for Element.
Implementations§
Source§impl ElementBuilder
impl ElementBuilder
Sourcepub fn prop(self, k: impl Into<String>, v: impl Into<Value>) -> Self
pub fn prop(self, k: impl Into<String>, v: impl Into<Value>) -> Self
Set a prop on the element.
Sourcepub fn visible(self, v: Visibility) -> Self
pub fn visible(self, v: Visibility) -> Self
Attach a visibility rule.
Sourcepub fn each(self, path: impl Into<String>, as_: impl Into<String>) -> Self
pub fn each(self, path: impl Into<String>, as_: impl Into<String>) -> Self
Set the $each iteration directive on this element.
path is a JSON-pointer to an array in Spec.data; as_ is the
loop-variable name used inside this element’s $data prop bindings
(e.g. .each("/data/products", "p") then .prop("name", json!({"$data":"/p/name"}))).
Template elements carry data-bound props whose type cannot be checked
before $each expansion — Catalog::validate skips per-element Props
validation for elements whose each is Some (see catalog.rs).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ElementBuilder
impl RefUnwindSafe for ElementBuilder
impl Send for ElementBuilder
impl Sync for ElementBuilder
impl Unpin for ElementBuilder
impl UnsafeUnpin for ElementBuilder
impl UnwindSafe for ElementBuilder
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