Skip to main content

object

Function object 

Source
pub fn object<I, K>(members: I) -> LinoValue
where I: IntoIterator<Item = (K, LinoValue)>, K: Into<String>,
Expand description

Build an object from its members, keeping them in the given order.

ยงExamples

use lino_rest_api::value::{object, string};

let task = object([("title", string("Ship it"))]);
assert_eq!(lino_rest_api::codec::encode(&task), "(\n  title \"Ship it\"\n)");