Trait ambient_ui::editor::Editor
source · pub trait Editor {
// Required method
fn editor(self, on_change: ChangeCb<Self>, opts: EditorOpts) -> Element;
// Provided methods
fn edit_or_view(
self,
on_change: Option<ChangeCb<Self>>,
opts: EditorOpts
) -> Element
where Self: Sized { ... }
fn view(self, opts: EditorOpts) -> Element
where Self: Sized { ... }
}
Expand description
A trait for types that can be edited in the UI.
Implementing this trait allows you to make a UI editor for any value of your type.
Required Methods§
Provided Methods§
sourcefn edit_or_view(
self,
on_change: Option<ChangeCb<Self>>,
opts: EditorOpts
) -> Elementwhere
Self: Sized,
fn edit_or_view(
self,
on_change: Option<ChangeCb<Self>>,
opts: EditorOpts
) -> Elementwhere
Self: Sized,
sourcefn view(self, opts: EditorOpts) -> Elementwhere
Self: Sized,
fn view(self, opts: EditorOpts) -> Elementwhere
Self: Sized,
Viewer for this value.
By default, this will call Editor::editor with a no-op callback.
Object Safety§
This trait is not object safe.