pub struct SiteMap { /* private fields */ }Expand description
Placement input: the known sites, per-node site assignments, and per-node
profiles that place resolves against a graph.
Implementations§
Source§impl SiteMap
impl SiteMap
Sourcepub fn new(default_site: SiteProfile) -> Self
pub fn new(default_site: SiteProfile) -> Self
Builds a site map whose default (fallback) site is the given profile.
Sourcepub fn with_site(self, site: SiteProfile) -> Self
pub fn with_site(self, site: SiteProfile) -> Self
Registers another site, returning the updated map.
Sourcepub fn assign_node(
self,
node: impl Into<NodeId>,
site: impl Into<SiteId>,
) -> Self
pub fn assign_node( self, node: impl Into<NodeId>, site: impl Into<SiteId>, ) -> Self
Assigns a node to a site, returning the updated map.
Sourcepub fn with_node_profile(
self,
node: impl Into<NodeId>,
profile: PlacementNodeProfile,
) -> Self
pub fn with_node_profile( self, node: impl Into<NodeId>, profile: PlacementNodeProfile, ) -> Self
Sets a node’s placement profile, returning the updated map.
Sourcepub fn site_for(&self, node: &NodeId) -> &SiteId
pub fn site_for(&self, node: &NodeId) -> &SiteId
Returns the site a node is assigned to, falling back to the default site.
Sourcepub fn profile_for(&self, node: &NodeId) -> PlacementNodeProfile
pub fn profile_for(&self, node: &NodeId) -> PlacementNodeProfile
Returns a node’s placement profile, defaulting to block-local.
Sourcepub fn site_profile(&self, site: &SiteId) -> Option<&SiteProfile>
pub fn site_profile(&self, site: &SiteId) -> Option<&SiteProfile>
Looks up a registered site profile by id.
Trait Implementations§
impl Eq for SiteMap
impl StructuralPartialEq for SiteMap
Auto Trait Implementations§
impl Freeze for SiteMap
impl RefUnwindSafe for SiteMap
impl Send for SiteMap
impl Sync for SiteMap
impl Unpin for SiteMap
impl UnsafeUnpin for SiteMap
impl UnwindSafe for SiteMap
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