pub trait Selectable:
Clone
+ PartialEq
+ 'static {
// Required methods
fn picked_from() -> Vec<&'static str>;
fn from_picked(picked: &PickedElement) -> Option<Self>;
fn picked(&self) -> PickedElement;
fn select(reader: &Reader<'_>, hit: &PickedElement) -> Option<Self>;
fn drawn(&self, reader: &Reader<'_>) -> Vec<PickedElement>;
// Provided method
fn visuals(&self, reader: &Reader<'_>) -> Vec<Visual> { ... }
}Expand description
What a reference field holds, one value per pick.
Required Methods§
Sourcefn picked_from() -> Vec<&'static str>
fn picked_from() -> Vec<&'static str>
The kinds of what an editor draws that a click picks one from.
Sourcefn from_picked(picked: &PickedElement) -> Option<Self>
fn from_picked(picked: &PickedElement) -> Option<Self>
The value picked names as Selectable::picked does: what a
field sent back held already.
Sourcefn picked(&self) -> PickedElement
fn picked(&self) -> PickedElement
The value as a pick names it: what the front end shows held.
Sourcefn select(reader: &Reader<'_>, hit: &PickedElement) -> Option<Self>
fn select(reader: &Reader<'_>, hit: &PickedElement) -> Option<Self>
The value a click on hit selects, read through reader: none, for
a hit that selects none.
Sourcefn drawn(&self, reader: &Reader<'_>) -> Vec<PickedElement>
fn drawn(&self, reader: &Reader<'_>) -> Vec<PickedElement>
What an editor draws of it, to light while it is held.
Provided Methods§
Sourcefn visuals(&self, reader: &Reader<'_>) -> Vec<Visual>
fn visuals(&self, reader: &Reader<'_>) -> Vec<Visual>
What an editor draws of it besides lighting what it is picked from
(Selectable::drawn), while it is held or a click would pick it:
nothing, for an element drawn as itself; a frame, as a triad along
its axes. In the world, as the part is drawn; styled by the editor
as held or as hovered.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<T: HasElements<K>, K: SelectableElement<T>> Selectable for ElementReference<T, K>
An element of an instance is selected and drawn as the instance’s own
part selects and draws it, behind the instance’s path: what the part is
placed in does not discriminate where an element is from.
impl<T: HasElements<K>, K: SelectableElement<T>> Selectable for ElementReference<T, K>
An element of an instance is selected and drawn as the instance’s own part selects and draws it, behind the instance’s path: what the part is placed in does not discriminate where an element is from.