Skip to content

Instantly share code, notes, and snippets.

View n1ght-hunter's full-sized avatar

NightHunter n1ght-hunter

View GitHub Profile

BSN Cheatsheet

Syntax Reference

Syntax Meaning
TypeName Insert component with all fields defaulted. Also selects the #[default] enum variant.
TypeName { field: val } Insert component with specific fields; unset fields still default — no ..default() needed.
TypeName(val) Tuple / newtype constructor. val is implicitly .into()'d.
{ expr } Arbitrary expression at component position — must implement Scene.
use iced::{
color,
mouse::{self, Button},
Color, Element, Rectangle, Size,
};
use iced_native::{
layout,
widget::{tree, Tree},
Widget,
};