/
githubmirror
/
sway
Обзор
Документация
Войти
/
githubmirror
/
sway
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
examples/structs/src/data_structures.sw
30 строк
535 B
Igor Rončević
Struct field privacy (#5508)
30 янв 2024, 16:15
Не верифицирован
30 янв 2024, 16:15
8320c1b
Код
Авторство
О чём код?
// the _data_structures_ module library; // Declare a struct type pub struct Foo { pub bar: u64, pub baz: bool, } // Struct types for destructuring pub struct Point { pub x: u64, pub y: u64, } pub struct Line { pub p1: Point, pub p2: Point, } pub struct TupleInStruct { pub nested_tuple: (u64, (u32, (bool, str))), } // Struct type instantiable only in the module _data_structures_ pub struct StructWithPrivateFields { pub public_field: u64, private_field: u64, other_private_field: u64, }