pub struct RwRefAccess<T> {
base: Arc<RwLock<T>>,
}Expand description
Wrapper around a Netlist or Layout, etc. into a Arc<RwLock<_>> to provide
save read and write access. Access is checked at runtime.
If only read access is required, then it might be more efficient to use crate::reference_access.
In contrast to the API of HierarchyBase and others the object-like API avoids returning iterators
but returns vectors of elements. This allows to keep the lock-time short.
Fields§
§base: Arc<RwLock<T>>Implementations§
source§impl<T> RwRefAccess<T>
impl<T> RwRefAccess<T>
pub fn new(base: T) -> Self
sourcepub fn read(&self) -> RwLockReadGuard<'_, T>
pub fn read(&self) -> RwLockReadGuard<'_, T>
Get read access to the underlying data structure.
Panics
Panics when called during an ongoing write access.
sourcepub fn write(&self) -> RwLockWriteGuard<'_, T>
pub fn write(&self) -> RwLockWriteGuard<'_, T>
Get exclusive write access to the underlying data structure.
Panics
Panics when called during an ongoing read or write access.
source§impl<H: HierarchyBase> RwRefAccess<H>
impl<H: HierarchyBase> RwRefAccess<H>
sourcefn cell_inst(&self, id: H::CellInstId) -> CellInstRef<H>
fn cell_inst(&self, id: H::CellInstId) -> CellInstRef<H>
Get a cell instance ‘object’ by its ID.
sourcepub fn cell_by_name(&self, name: &str) -> Option<CellRef<H>>
pub fn cell_by_name(&self, name: &str) -> Option<CellRef<H>>
Find a cell by its name.