Struct iced_glow::widget::pane_grid::State [−][src]
The state of a PaneGrid
.
It keeps track of the state of each Pane
and the position of each
Split
.
The State
needs to own any mutable contents a Pane
may need. This is
why this struct is generic over the type T
. Values of this type are
provided to the view function of PaneGrid::new
for displaying each
Pane
.
Implementations
impl<T> State<T>
[src]
pub fn new(first_pane_state: T) -> (State<T>, Pane)
[src]
Creates a new State
, initializing the first pane with the provided
state.
pub fn with_configuration(config: impl Into<Configuration<T>>) -> State<T>
[src]
Creates a new State
with the given Configuration
.
pub fn len(&self) -> usize
[src]
Returns the total amount of panes in the State
.
pub fn get(&self, pane: &Pane) -> Option<&T>
[src]
Returns the internal state of the given Pane
, if it exists.
pub fn get_mut(&mut self, pane: &Pane) -> Option<&mut T>
[src]
Returns the internal state of the given Pane
with mutability, if it
exists.
pub fn iter(&self) -> impl Iterator<Item = (&Pane, &T)>
[src]
Returns an iterator over all the panes of the State
, alongside its
internal state.
pub fn iter_mut(&mut self) -> impl Iterator<Item = (&Pane, &mut T)>
[src]
Returns a mutable iterator over all the panes of the State
,
alongside its internal state.
pub fn layout(&self) -> &Node
[src]
Returns the layout of the State
.
pub fn adjacent(&self, pane: &Pane, direction: Direction) -> Option<Pane>
[src]
pub fn split(
&mut self,
axis: Axis,
pane: &Pane,
state: T
) -> Option<(Pane, Split)>
[src]
&mut self,
axis: Axis,
pane: &Pane,
state: T
) -> Option<(Pane, Split)>
Splits the given Pane
into two in the given Axis
and
initializing the new Pane
with the provided internal state.
pub fn swap(&mut self, a: &Pane, b: &Pane)
[src]
Swaps the position of the provided panes in the State
.
If you want to swap panes on drag and drop in your PaneGrid
, you
will need to call this method when handling a DragEvent
.
pub fn resize(&mut self, split: &Split, ratio: f32)
[src]
Resizes two panes by setting the position of the provided Split
.
The ratio is a value in [0, 1], representing the exact position of a
Split
between two panes.
If you want to enable resize interactions in your PaneGrid
, you will
need to call this method when handling a ResizeEvent
.
pub fn close(&mut self, pane: &Pane) -> Option<(T, Pane)>
[src]
Closes the given Pane
and returns its internal state and its closest
sibling, if it exists.
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for State<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for State<T> where
T: Send,
T: Send,
impl<T> Sync for State<T> where
T: Sync,
T: Sync,
impl<T> Unpin for State<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for State<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,