Skip to main content

SiteMap

Struct SiteMap 

Source
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

Source

pub fn new(default_site: SiteProfile) -> Self

Builds a site map whose default (fallback) site is the given profile.

Source

pub fn with_site(self, site: SiteProfile) -> Self

Registers another site, returning the updated map.

Source

pub fn assign_node( self, node: impl Into<NodeId>, site: impl Into<SiteId>, ) -> Self

Assigns a node to a site, returning the updated map.

Source

pub fn with_node_profile( self, node: impl Into<NodeId>, profile: PlacementNodeProfile, ) -> Self

Sets a node’s placement profile, returning the updated map.

Source

pub fn site_for(&self, node: &NodeId) -> &SiteId

Returns the site a node is assigned to, falling back to the default site.

Source

pub fn profile_for(&self, node: &NodeId) -> PlacementNodeProfile

Returns a node’s placement profile, defaulting to block-local.

Source

pub fn site_profile(&self, site: &SiteId) -> Option<&SiteProfile>

Looks up a registered site profile by id.

Trait Implementations§

Source§

impl Clone for SiteMap

Source§

fn clone(&self) -> SiteMap

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SiteMap

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for SiteMap

Source§

impl PartialEq for SiteMap

Source§

fn eq(&self, other: &SiteMap) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SiteMap

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.