Skip to main content

Node

Struct Node 

Source
pub struct Node {
Show 99 fields pub kind: Kind, pub id: &'static str, pub width: Size, pub height: Size, pub min_width: f32, pub min_height: f32, pub horizontal: bool, pub measure_all_children: bool, pub layout_direction: u8, pub fill_viewport: bool, pub clip_to_padding_disabled: bool, pub clip_children_disabled: bool, pub weight: f32, pub weight_sum: f32, pub divider_color: Option<Color>, pub divider_thickness: f32, pub divider_flags: u8, pub divider_padding: f32, pub padding_edges: [f32; 4], pub padding_explicit: [bool; 4], pub background_padding: Option<[f32; 4]>, pub background_min_size: [f32; 2], pub padding_relative: [Option<f32>; 2], pub margin: [f32; 4], pub margin_relative: [Option<f32>; 2], pub layout_gravity: [u8; 2], pub absolute_position: [f32; 2], pub relative_rules: &'static [RelativeRule], pub layout_gravity_explicit: bool, pub content_gravity: [u8; 2], pub text: &'static str, pub hint: &'static str, pub chrono_format: &'static str, pub count_down: bool, pub clock_12: &'static str, pub clock_24: &'static str, pub input_type: u8, pub text_on: &'static str, pub text_off: &'static str, pub text_size: f32, pub letter_spacing_em: f32, pub line_spacing_extra: f32, pub line_spacing_multiplier: f32, pub text_bold: bool, pub text_all_caps: bool, pub max_lines: usize, pub min_lines: usize, pub ellipsize_end: bool, pub ellipsize_side: u8, pub single_line: bool, pub align: u8, pub color: Option<Color>, pub text_color_states: &'static [TintState], pub background: Option<Color>, pub foreground: Option<Color>, pub foreground_radius: f32, pub foreground_size: [f32; 2], pub foreground_padding: Option<[f32; 4]>, pub foreground_gravity: [u8; 2], pub foreground_excludes_padding: bool, pub background_stroke: Option<Color>, pub background_stroke_width: f32, pub foreground_stroke: Option<Color>, pub foreground_stroke_width: f32, pub radius: f32, pub clickable: bool, pub icon: MaterialIcon, pub image_src: &'static str, pub image_scale: u8, pub image_adjust_bounds: bool, pub image_max_width: Option<f32>, pub image_max_height: Option<f32>, pub image_tint: Option<Color>, pub image_tint_states: &'static [TintState], pub image_tint_mode: u8, pub image_alpha: u8, pub view_alpha: f32, pub image_builtin: bool, pub enabled: bool, pub checked: bool, pub checked_button: &'static str, pub min: f32, pub max: f32, pub progress: f32, pub secondary_progress: f32, pub indeterminate: bool, pub num_stars: usize, pub rating: f32, pub step_size: f32, pub indicator: bool, pub mirror_for_rtl: bool, pub animation_in: Option<AlphaAnimation>, pub animation_out: Option<AlphaAnimation>, pub translate_in: Option<TranslateAnimation>, pub translate_out: Option<TranslateAnimation>, pub auto_start: bool, pub flip_interval: f64, pub visibility: Visibility, pub children: &'static [Node],
}

Fields§

§kind: Kind§id: &'static str§width: Size§height: Size§min_width: f32§min_height: f32§horizontal: bool§measure_all_children: bool§layout_direction: u8

0 inherits, 1 is left-to-right, and 2 is right-to-left.

§fill_viewport: bool§clip_to_padding_disabled: bool

Android ViewGroup clips children to its padding by default.

§clip_children_disabled: bool

Android ViewGroup clips each child to its bounds by default.

§weight: f32§weight_sum: f32

Zero uses the sum of the visible child weights.

§divider_color: Option<Color>§divider_thickness: f32§divider_flags: u8§divider_padding: f32§padding_edges: [f32; 4]

Physical left, top, right and bottom padding and optional relative overrides.

§padding_explicit: [bool; 4]§background_padding: Option<[f32; 4]>§background_min_size: [f32; 2]§padding_relative: [Option<f32>; 2]§margin: [f32; 4]

Physical left, top, right and bottom margins.

§margin_relative: [Option<f32>; 2]

Optional start and end margins override the physical side in the current direction.

§layout_gravity: [u8; 2]

FrameLayout gravity: horizontal start/center/end/left/right, vertical top/center/bottom.

§absolute_position: [f32; 2]

Physical coordinates for children of deprecated AbsoluteLayout.

§relative_rules: &'static [RelativeRule]§layout_gravity_explicit: bool§content_gravity: [u8; 2]§text: &'static str§hint: &'static str§chrono_format: &'static str§count_down: bool§clock_12: &'static str§clock_24: &'static str§input_type: u8

0 text, 1 email, 2 telephone, 3 numeric, 4 password, 5 decimal.

§text_on: &'static str§text_off: &'static str§text_size: f32§letter_spacing_em: f32

Android letter spacing in em units.

§line_spacing_extra: f32§line_spacing_multiplier: f32§text_bold: bool§text_all_caps: bool§max_lines: usize

Zero means no explicit line limit.

§min_lines: usize§ellipsize_end: bool§ellipsize_side: u8

1 truncates at the start, 2 in the middle.

§single_line: bool§align: u8§color: Option<Color>§text_color_states: &'static [TintState]§background: Option<Color>§foreground: Option<Color>

Solid foreground painted over this view and its descendants.

§foreground_radius: f32

Negative radius represents an oval foreground.

§foreground_size: [f32; 2]§foreground_padding: Option<[f32; 4]>§foreground_gravity: [u8; 2]

Horizontal/vertical foreground gravity; 5 means fill.

§foreground_excludes_padding: bool§background_stroke: Option<Color>§background_stroke_width: f32§foreground_stroke: Option<Color>§foreground_stroke_width: f32§radius: f32§clickable: bool§icon: MaterialIcon§image_src: &'static str§image_scale: u8

Image scale mode encoded by the Android XML importer.

§image_adjust_bounds: bool

Preserve drawable aspect ratio when a view dimension can wrap.

§image_max_width: Option<f32>§image_max_height: Option<f32>§image_tint: Option<Color>§image_tint_states: &'static [TintState]§image_tint_mode: u8

0 SRC_ATOP (XML default), 1 SRC_IN, 2 SRC_OVER, 3 MULTIPLY, 4 SCREEN, 5 ADD.

§image_alpha: u8

Drawable opacity in the Android imageAlpha range.

§view_alpha: f32

Opacity applied to the view and its children.

§image_builtin: bool§enabled: bool§checked: bool§checked_button: &'static str§min: f32§max: f32§progress: f32§secondary_progress: f32§indeterminate: bool§num_stars: usize§rating: f32§step_size: f32§indicator: bool§mirror_for_rtl: bool§animation_in: Option<AlphaAnimation>§animation_out: Option<AlphaAnimation>§translate_in: Option<TranslateAnimation>§translate_out: Option<TranslateAnimation>§auto_start: bool§flip_interval: f64§visibility: Visibility§children: &'static [Node]

Implementations§

Source§

impl Node

Source

pub fn set_table_column_collapsed( &self, state: &mut LayoutState, column: usize, collapsed: bool, ) -> bool

Override a named table column’s collapsed state. Returns false for unnamed/non-table nodes.

Source§

impl Node

Source

pub fn set_switcher_text( &self, state: &mut LayoutState, text: &str, advance: bool, ) -> bool

Set text in a TextSwitcher, optionally switching to its next child. The switcher must have a stable XML ID when nested in another layout.

Source

pub fn set_switcher_image(&self, state: &mut LayoutState, source: &str) -> bool

Set the image of the next ImageSwitcher child and select it.

Source

pub fn render_floating_media_controller( &'static self, f: &mut Frame<'_>, anchor: Rect, height: f32, state: &mut LayoutState, ) -> Option<&'static str>

Paint an explicitly shown floating MediaController at the bottom of its anchor.

Source

pub fn render( &'static self, f: &mut Frame<'_>, bounds: Rect, state: &mut LayoutState, ) -> Option<&'static str>

Trait Implementations§

Source§

impl Clone for Node

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Node

Auto Trait Implementations§

§

impl Forget for Node

§

impl Freeze for Node

§

impl Move for Node

§

impl RefUnwindSafe for Node

§

impl Send for Node

§

impl Sync for Node

§

impl Unpin for Node

§

impl UnsafeUnpin for Node

§

impl UnwindSafe for Node

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.