pub struct Layers {
pub slots: SlotMap<LayerKey, Layer>,
pub nums: HashMap<i16, LayerKey>,
pub names: HashMap<String, LayerKey>,
}Expand description
§Layer Set & Manager
Keep track of active layers, and index them by name and number.
Fields§
§slots: SlotMap<LayerKey, Layer>§nums: HashMap<i16, LayerKey>§names: HashMap<String, LayerKey>Implementations§
Source§impl Layers
impl Layers
Sourcepub fn add(&mut self, layer: Layer) -> LayerKey
pub fn add(&mut self, layer: Layer) -> LayerKey
Add a Layer to our slot-map and number-map, and name-map
Sourcepub fn nextnum(&self) -> LayoutResult<i16>
pub fn nextnum(&self) -> LayoutResult<i16>
Get the next-available (lowest) layer number
Sourcepub fn keynum(&self, num: i16) -> Option<LayerKey>
pub fn keynum(&self, num: i16) -> Option<LayerKey>
Get a reference to the LayerKey for layer-number num
Sourcepub fn keyname(&self, name: impl Into<String>) -> Option<LayerKey>
pub fn keyname(&self, name: impl Into<String>) -> Option<LayerKey>
Get a reference to the LayerKey layer-name name
Sourcepub fn get_or_insert(
&mut self,
layernum: i16,
purposenum: i16,
) -> LayoutResult<(LayerKey, LayerPurpose)>
pub fn get_or_insert( &mut self, layernum: i16, purposenum: i16, ) -> LayoutResult<(LayerKey, LayerPurpose)>
Get the (LayerKey, LayerPurpose) objects for numbers (layernum, purposenum) if present.
Inserts a new Layer if layernum is not present.
Returns LayerPurpose::Other(purposenum) if purposenum is not present on that layer.
Source§impl Layers
impl Layers
Sourcepub fn from_proto(library_pb: &Technology) -> LayoutResult<Layers>
pub fn from_proto(library_pb: &Technology) -> LayoutResult<Layers>
Load the struct from an external Technology protobuf.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Layers
impl<'de> Deserialize<'de> for Layers
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 Layers
impl RefUnwindSafe for Layers
impl Send for Layers
impl Sync for Layers
impl Unpin for Layers
impl UnsafeUnpin for Layers
impl UnwindSafe for Layers
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