pub trait HasElements<K: Kind>: 'static {
type Element<'a>;
const SINGLETON: Option<&'static str> = None;
// Required method
fn element(&self, name: &str) -> GeopResult<Self::Element<'_>>;
// Provided methods
fn undefined() -> Option<&'static Self> { ... }
fn names_target(name: &str) -> bool { ... }
}Expand description
A target that holds elements of the kind K, each by a stable name.
Elements are the only way a target is read: one meant to be read whole —
a sketch, to sweep — is a kind of its own, impl Kind for Sketch and
impl HasElements<Sketch> for Sketch, its one element the empty name
(ElementReference::whole).
Provided Associated Constants§
Required Associated Types§
Required Methods§
Sourcefn element(&self, name: &str) -> GeopResult<Self::Element<'_>>
fn element(&self, name: &str) -> GeopResult<Self::Element<'_>>
The element name, or why there is none.
Provided Methods§
Sourcefn undefined() -> Option<&'static Self>
fn undefined() -> Option<&'static Self>
What the target reads as where no step made it, if it reads as anything then — the datums every part starts with. None by default: reading it fails.
Sourcefn names_target(name: &str) -> bool
fn names_target(name: &str) -> bool
Whether the target named name could be one of this type: what
tells a pick of an element of it from one of a target of another
type with elements of the same kind (ElementReference::from_picked).
The singleton’s name, for a singleton; any name, by default.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".