pub struct NodeProfile {
pub mobility: NodeMobility,
pub resources: NodeResources,
pub can_parent: bool,
pub prefer_leaf: bool,
pub parent_priority: u8,
}Expand description
Node profile combining mobility and resources
Fields§
§mobility: NodeMobilityMobility type
resources: NodeResourcesResource capacity
can_parent: boolWhether this node can act as a parent
prefer_leaf: boolWhether this node prefers to be a leaf (never parent)
parent_priority: u8Priority for parent selection (higher = more preferred)
Implementations§
Source§impl NodeProfile
impl NodeProfile
Sourcepub fn static_node(resources: NodeResources) -> Self
pub fn static_node(resources: NodeResources) -> Self
Create a static node profile (command post, fixed infrastructure)
Sourcepub fn mobile_node(resources: NodeResources) -> Self
pub fn mobile_node(resources: NodeResources) -> Self
Create a mobile node profile (vehicle, soldier)
Sourcepub fn semi_mobile_node(resources: NodeResources) -> Self
pub fn semi_mobile_node(resources: NodeResources) -> Self
Create a semi-mobile node profile (relocatable but stable)
Sourcepub fn is_parent_candidate(&self, requirements: &ParentingRequirements) -> bool
pub fn is_parent_candidate(&self, requirements: &ParentingRequirements) -> bool
Check if this node should be considered as a parent candidate
Trait Implementations§
Source§impl Clone for NodeProfile
impl Clone for NodeProfile
Source§fn clone(&self) -> NodeProfile
fn clone(&self) -> NodeProfile
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NodeProfile
impl Debug for NodeProfile
Source§impl<'de> Deserialize<'de> for NodeProfile
impl<'de> Deserialize<'de> for NodeProfile
Source§fn 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 Freeze for NodeProfile
impl RefUnwindSafe for NodeProfile
impl Send for NodeProfile
impl Sync for NodeProfile
impl Unpin for NodeProfile
impl UnsafeUnpin for NodeProfile
impl UnwindSafe for NodeProfile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more