Struct ratio_graph::Node
source · [−]pub struct Node {
pub id: Uuid,
pub name: String,
pub kind: String,
pub labels: Vec<String>,
pub weights: HashMap<String, f64>,
pub annotations: HashMap<String, String>,
pub parent: Option<Uuid>,
pub children: Vec<Uuid>,
pub is_bus: bool,
}Fields
id: UuidUnique instance ID.
name: StringInstance name.
kind: StringMain category of this instance.
labels: Vec<String>Instance labels.
weights: HashMap<String, f64>Numeric instance weights.
annotations: HashMap<String, String>Miscellaneous data fields for this instance.
parent: Option<Uuid>ID of the parent of this node, if any.
children: Vec<Uuid>IDs of this node’s children,
is_bus: boolWhether this node is a bus node for its parent.
Implementations
sourceimpl Node
impl Node
sourcepub fn new(
id: Option<Uuid>,
name: Option<String>,
kind: Option<String>,
labels: Option<Vec<String>>,
weights: Option<HashMap<String, f64>>,
annotations: Option<HashMap<String, String>>,
parent: Option<Uuid>,
children: Option<Vec<Uuid>>,
is_bus: Option<bool>
) -> Self
pub fn new(
id: Option<Uuid>,
name: Option<String>,
kind: Option<String>,
labels: Option<Vec<String>>,
weights: Option<HashMap<String, f64>>,
annotations: Option<HashMap<String, String>>,
parent: Option<Uuid>,
children: Option<Vec<Uuid>>,
is_bus: Option<bool>
) -> Self
Create a new node struct with arguments.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Node
impl<'de> Deserialize<'de> for Node
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnwindSafe for Node
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self from the equivalent element of its
superset. Read more
fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if self is actually part of its subset T (and can be converted to it).
fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset but without any property checks. Always succeeds.
fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self to the equivalent element of its superset.