pub trait HasLabel {
// Required methods
fn label(&self) -> Option<&String>;
fn set_label<S>(&mut self, label: S)
where S: Into<String>;
fn unset_label(&mut self);
fn with_label<S>(self, label: S) -> Self
where S: Into<String>,
Self: Sized;
}
Expand description
A label is a human-readable and generally descriptive text that helps the readability of Net representations.
Required Methods§
Sourcefn label(&self) -> Option<&String>
fn label(&self) -> Option<&String>
Note: if a label is expected and this method returns None
and the object implements
HasIdentity
use the id
value as the label.
Sourcefn unset_label(&mut self)
fn unset_label(&mut self)
Set the object’s label to None
.
Sourcefn with_label<S>(self, label: S) -> Self
fn with_label<S>(self, label: S) -> Self
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.