Skip to main content

first

Function first 

Source
pub fn first(value: &Value) -> Result<Value, Error>
Expand description

Returns the first item from an iterable.

If the list is empty undefined is returned. Like in Jinja2, undefined values are returned unchanged unless strict undefined behavior is used.

<dl>
  <dt>primary email
  <dd>{{ user.email_addresses|first|default('no user') }}
</dl>