Trait HasLabel

Source
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§

Source

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.

Source

fn set_label<S>(&mut self, label: S)
where S: Into<String>,

Set the object’s label to the string value label.

Source

fn unset_label(&mut self)

Set the object’s label to None.

Source

fn with_label<S>(self, label: S) -> Self
where S: Into<String>, Self: Sized,

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.

Implementors§