Skip to main content

TreeView

Struct TreeView 

Source
pub struct TreeView<Id, Node = String> { /* private fields */ }
Expand description

Tree view component with selection and expand/collapse

Implementations§

Source§

impl<Id, Node> TreeView<Id, Node>

Source

pub fn new() -> Self

Create a new TreeView

Source

pub fn render_widget( &mut self, frame: &mut Frame<'_>, area: Rect, props: TreeViewRenderProps<'_, Id, Node>, )
where Id: Clone + Eq + Hash + 'static,

Render the widget without requiring selection callbacks.

Trait Implementations§

Source§

impl<Id, Node, A> Component<A> for TreeView<Id, Node>
where Id: Clone + Eq + Hash + 'static,

Source§

type Props<'a> = TreeViewProps<'a, Id, Node, A> where Node: 'a

Data required to render the component (read-only)
Source§

fn handle_event( &mut self, event: &EventKind, props: Self::Props<'_>, ) -> impl IntoIterator<Item = A>

Handle an event and return actions to dispatch Read more
Source§

fn render(&mut self, frame: &mut Frame<'_>, area: Rect, props: Self::Props<'_>)

Render the component to the frame
Source§

impl<Id, Node> ComponentDebugState for TreeView<Id, Node>

Source§

impl<Id, Node> Default for TreeView<Id, Node>

Source§

fn default() -> Self

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

impl<Id, Node, A, Ctx> InteractiveComponent<A, Ctx> for TreeView<Id, Node>
where Id: Clone + Eq + Hash + 'static,

Source§

type Props<'a> = TreeViewProps<'a, Id, Node, A> where Node: 'a

Source§

fn update( &mut self, input: ComponentInput<'_, Ctx>, props: Self::Props<'_>, ) -> HandlerResponse<A>

Source§

fn render(&mut self, frame: &mut Frame<'_>, area: Rect, props: Self::Props<'_>)

Source§

fn subscriptions() -> &'static [EventType]

Event types this component should receive when bound through ComponentHost. Read more

Auto Trait Implementations§

§

impl<Id, Node> Freeze for TreeView<Id, Node>

§

impl<Id, Node> RefUnwindSafe for TreeView<Id, Node>

§

impl<Id, Node> Send for TreeView<Id, Node>

§

impl<Id, Node> Sync for TreeView<Id, Node>

§

impl<Id, Node> Unpin for TreeView<Id, Node>

§

impl<Id, Node> UnsafeUnpin for TreeView<Id, Node>

§

impl<Id, Node> UnwindSafe for TreeView<Id, 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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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.