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
sourceimpl<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.
sourceimpl<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.
sourceimpl<H: HierarchyEdit> RwRefAccess<H>
impl<H: HierarchyEdit> RwRefAccess<H>
pub fn create_cell(&self, name: H::NameType) -> CellRef<H>
pub fn remove_cell(&self, cell: CellRef<H>)
Trait Implementations
sourceimpl<T> Clone for RwRefAccess<T>
impl<T> Clone for RwRefAccess<T>
sourceimpl<T> Hash for RwRefAccess<T>
impl<T> Hash for RwRefAccess<T>
sourceimpl<T> PartialEq<RwRefAccess<T>> for RwRefAccess<T>
impl<T> PartialEq<RwRefAccess<T>> for RwRefAccess<T>
impl<T> Eq for RwRefAccess<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for RwRefAccess<T>
impl<T> Send for RwRefAccess<T> where
T: Send + Sync,
impl<T> Sync for RwRefAccess<T> where
T: Send + Sync,
impl<T> Unpin for RwRefAccess<T>
impl<T> UnwindSafe for RwRefAccess<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more