Struct Path

Source
pub struct Path<'a> { /* private fields */ }
Expand description

Path used to get the id of a specific pane in the mux. self can be directed by calling .up(), .down(), .left() and .right() on the instance. To get the final id of a pane .build().

Implementations§

Source§

impl<'a> Path<'a>

Source

pub fn build(self) -> Option<Id>

Finsihing of the path, Option contains the target Id If Option None no Id could be found fitting to the path Consumes the path

§Example
let mut mux = Mux::new();
let node1 = mux.add_right_of(DummyView, mux.root().build().unwrap()).unwrap();
mux.add_below(DummyView, node1);
let path = mux.root().up().build();
assert_eq!(node1, path.unwrap());
Source

pub fn up(self) -> Self

Going up from the current position in the mux Target can be get by calling .build()

Source

pub fn down(self) -> Self

Going down from the current position in the mux Target can be get by calling .build()

Source

pub fn left(self) -> Self

Going left from the current position in the mux Target can be get by calling .build()

Source

pub fn right(self) -> Self

Going right from the current position in the mux Target can be get by calling .build()

Auto Trait Implementations§

§

impl<'a> Freeze for Path<'a>

§

impl<'a> !RefUnwindSafe for Path<'a>

§

impl<'a> Send for Path<'a>

§

impl<'a> Sync for Path<'a>

§

impl<'a> Unpin for Path<'a>

§

impl<'a> !UnwindSafe for Path<'a>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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

impl<T> With for T

Source§

fn wrap_with<U, F>(self, f: F) -> U
where F: FnOnce(Self) -> U,

Calls the given closure and return the result. Read more
Source§

fn with<F>(self, f: F) -> Self
where F: FnOnce(&mut Self),

Calls the given closure on self.
Source§

fn try_with<E, F>(self, f: F) -> Result<Self, E>
where F: FnOnce(&mut Self) -> Result<(), E>,

Calls the given closure on self.
Source§

fn with_if<F>(self, condition: bool, f: F) -> Self
where F: FnOnce(&mut Self),

Calls the given closure if condition == true.