Struct egui_tiles::Tiles

source ·
pub struct Tiles<Pane> { /* private fields */ }
Expand description

Contains all tile state, but no root.

use egui_tiles::{Tiles, TileId, Tree};

struct Pane { } // put some state here

let mut tiles = Tiles::default();
let tabs: Vec<TileId> = vec![tiles.insert_pane(Pane { }), tiles.insert_pane(Pane { })];
let root: TileId = tiles.insert_tab_tile(tabs);

let tree = Tree::new(root, tiles);

Implementations§

source§

impl<Pane> Tiles<Pane>

source

pub fn get(&self, tile_id: TileId) -> Option<&Tile<Pane>>

source

pub fn get_mut(&mut self, tile_id: TileId) -> Option<&mut Tile<Pane>>

source

pub fn iter(&self) -> impl Iterator<Item = (&TileId, &Tile<Pane>)> + '_

All tiles, in arbitrary order

source

pub fn iter_mut( &mut self ) -> impl Iterator<Item = (&TileId, &mut Tile<Pane>)> + '_

All tiles, in arbitrary order

source

pub fn tile_ids(&self) -> impl Iterator<Item = TileId> + '_

All TileIds, in arbitrary order

source

pub fn tiles(&self) -> impl Iterator<Item = &Tile<Pane>> + '_

All Tiles in arbitrary order

source

pub fn tiles_mut(&mut self) -> impl Iterator<Item = &mut Tile<Pane>> + '_

All Tiles in arbitrary order

source

pub fn is_visible(&self, tile_id: TileId) -> bool

Tiles are visible by default.

Invisible tiles still retain their place in the tile hierarchy.

source

pub fn set_visible(&mut self, tile_id: TileId, visible: bool)

Tiles are visible by default.

Invisible tiles still retain their place in the tile hierarchy.

source

pub fn insert(&mut self, id: TileId, tile: Tile<Pane>)

source

pub fn remove(&mut self, id: TileId) -> Option<Tile<Pane>>

source

pub fn remove_recursively(&mut self, id: TileId) -> Vec<Tile<Pane>>

Remove the given tile and all child tiles, recursively.

All removed tiles are returned in unspecified order.

source

pub fn insert_new(&mut self, tile: Tile<Pane>) -> TileId

source

pub fn insert_pane(&mut self, pane: Pane) -> TileId

source

pub fn insert_container(&mut self, container: impl Into<Container>) -> TileId

source

pub fn insert_tab_tile(&mut self, children: Vec<TileId>) -> TileId

source

pub fn insert_horizontal_tile(&mut self, children: Vec<TileId>) -> TileId

source

pub fn insert_vertical_tile(&mut self, children: Vec<TileId>) -> TileId

source

pub fn insert_grid_tile(&mut self, children: Vec<TileId>) -> TileId

source

pub fn parent_of(&self, child_id: TileId) -> Option<TileId>

source

pub fn is_root(&self, tile_id: TileId) -> bool

source§

impl<Pane: PartialEq> Tiles<Pane>

source

pub fn find_pane(&self, needle: &Pane) -> Option<TileId>

Find the tile with the given pane.

Trait Implementations§

source§

impl<Pane: Clone> Clone for Tiles<Pane>

source§

fn clone(&self) -> Tiles<Pane>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<Pane: Debug> Debug for Tiles<Pane>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Pane> Default for Tiles<Pane>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de, Pane> Deserialize<'de> for Tiles<Pane>where Pane: Deserialize<'de>,

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<Pane: PartialEq> PartialEq<Tiles<Pane>> for Tiles<Pane>

source§

fn eq(&self, other: &Tiles<Pane>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Pane> Serialize for Tiles<Pane>where Pane: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<Pane> RefUnwindSafe for Tiles<Pane>where Pane: RefUnwindSafe,

§

impl<Pane> Send for Tiles<Pane>where Pane: Send,

§

impl<Pane> Sync for Tiles<Pane>where Pane: Sync,

§

impl<Pane> Unpin for Tiles<Pane>where Pane: Unpin,

§

impl<Pane> UnwindSafe for Tiles<Pane>where Pane: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,

source§

impl<T> SerializableAny for Twhere T: 'static + Any + Clone + Send + Sync,