pub struct NodeBuilder<R: RoleKind = AnyRole> { /* private fields */ }Expand description
Builds one annotated node and its children.
Implementations§
Source§impl<R: RoleKind> NodeBuilder<R>
impl<R: RoleKind> NodeBuilder<R>
Sourcepub fn child<R2: RoleType>(
self,
role: R2,
name: &str,
build: impl FnOnce(NodeBuilder<R2>) -> NodeBuilder<R2>,
) -> Self
pub fn child<R2: RoleType>( self, role: R2, name: &str, build: impl FnOnce(NodeBuilder<R2>) -> NodeBuilder<R2>, ) -> Self
Adds a child of a role, named unless name is empty.
Sourcepub fn generic(
self,
build: impl FnOnce(NodeBuilder<AnyRole>) -> NodeBuilder<AnyRole>,
) -> Self
pub fn generic( self, build: impl FnOnce(NodeBuilder<AnyRole>) -> NodeBuilder<AnyRole>, ) -> Self
Adds an annotated child with no role, which infers as a generic.
Sourcepub fn text_at(self, content: &str, bounds: Rect) -> Self
pub fn text_at(self, content: &str, bounds: Rect) -> Self
Adds an unannotated text call at fixed bounds.
Sourcepub fn bounds(self, x: f32, y: f32, width: f32, height: f32) -> Self
pub fn bounds(self, x: f32, y: f32, width: f32, height: f32) -> Self
Fixed bounds instead of the automatic layout.
Sourcepub fn component(self, kind: &'static str) -> Self
pub fn component(self, kind: &'static str) -> Self
Reports the annotation as a component’s, such as iced-cube’s.
Sourcepub fn description(self, text: &str) -> Self
pub fn description(self, text: &str) -> Self
The description.
Sourcepub fn carets(self, carets: impl IntoIterator<Item = (usize, Point)>) -> Self
pub fn carets(self, carets: impl IntoIterator<Item = (usize, Point)>) -> Self
Caret positions by byte offset.
Sourcepub fn cursor_seen(self, seen: CursorSeen) -> Self
pub fn cursor_seen(self, seen: CursorSeen) -> Self
The cursor kind handed to the widget this frame.
Sourcepub fn labelled_by(self, key: &str) -> Self
pub fn labelled_by(self, key: &str) -> Self
Named by the node with this key.
Sourcepub fn described_by(self, key: &str) -> Self
pub fn described_by(self, key: &str) -> Self
Described by the node with this key.
Explicitly hidden.
Sourcepub fn checked(self, state: impl Into<Checked>) -> Selfwhere
R: Checkable,
pub fn checked(self, state: impl Into<Checked>) -> Selfwhere
R: Checkable,
Checked, unchecked or mixed.
Sourcepub fn expanded(self, on: bool) -> Selfwhere
R: Expandable,
pub fn expanded(self, on: bool) -> Selfwhere
R: Expandable,
Content or a popup is shown.
Sourcepub fn selected(self, on: bool) -> Selfwhere
R: SelectableItem,
pub fn selected(self, on: bool) -> Selfwhere
R: SelectableItem,
Selected in its container.
Sourcepub fn range(self, now: f64, range: RangeInclusive<f64>) -> Selfwhere
R: RangeValue,
pub fn range(self, now: f64, range: RangeInclusive<f64>) -> Selfwhere
R: RangeValue,
A number within a range.
Sourcepub fn placeholder(self, text: &str) -> Selfwhere
R: Editable,
pub fn placeholder(self, text: &str) -> Selfwhere
R: Editable,
The placeholder.
Trait Implementations§
Auto Trait Implementations§
impl<R> Forget for NodeBuilder<R>
impl<R> Freeze for NodeBuilder<R>where
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
&'static str: Freeze,
String: Freeze,
*const LeafNode<String, String> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, String)>>: Freeze,
PhantomData<(StateName, StateValue)>: Freeze,
PhantomData<RawKey>: Freeze,
PhantomData<(usize, Point)>: Freeze,
PhantomData<Spec>: Freeze,
PhantomData<fn() -> R>: Freeze,
impl<R> Move for NodeBuilder<R>
impl<R> RefUnwindSafe for NodeBuilder<R>where
String: RefUnwindSafe,
impl<R> Send for NodeBuilder<R>
impl<R> Sync for NodeBuilder<R>
impl<R> Unpin for NodeBuilder<R>
impl<R> UnsafeUnpin for NodeBuilder<R>where
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
&'static str: UnsafeUnpin,
String: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
PhantomData<(StateName, StateValue)>: UnsafeUnpin,
PhantomData<RawKey>: UnsafeUnpin,
PhantomData<(usize, Point)>: UnsafeUnpin,
PhantomData<Spec>: UnsafeUnpin,
PhantomData<fn() -> R>: UnsafeUnpin,
impl<R> UnwindSafe for NodeBuilder<R>where
RawVecInner: UnwindSafe,
&'static str: UnwindSafe,
String: UnwindSafe,
BTreeMap<String, String>: UnwindSafe,
BoxRaw<RawAnnotation>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more