Function frunk_core::labelled::field_with_name[][src]

pub fn field_with_name<Label, Value>(
    name: &'static str,
    value: Value
) -> Field<Label, Value>
Expand description

Returns a new Field for a given value and custom name.

If you don’t want to provide a custom name and want to rely on the type you provide to build a name, then please use the field! macro.


#[macro_use] extern crate frunk; fn main() {
use frunk::labelled::chars::*;
use frunk::labelled::field_with_name;

let l = field_with_name::<(n,a,m,e),_>("name", "joe");
assert_eq!(l.value, "joe");
assert_eq!(, "name");