// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
//! Records demonstration
use moretypes::record;

#[record]
pub struct NamedRecord {
    // No need for pub qualifiers
    my_field: String,
}

#[record]
pub struct TupleRecord(String);

#[record]
pub struct GenericRecord<T>(T);

pub fn main() {
    let named = NamedRecord {
        my_field: String::from("FOO"),
    };
    println!("named.my_field = {}", named.my_field);

    let tuple = TupleRecord(String::from("BAR"));
    println!("tuple.0 = {}", tuple.0);

    let generic = GenericRecord(String::from("BAZ"));
    println!("generic.0 = {}", generic.0);
}
