pub struct ResourceRegistry<T> { /* private fields */ }Expand description
Registry of named shared resources.
Used in GraphBuilder::build() to allocate resources and distribute
capability handles to graph nodes.
Implementations§
Source§impl<T> ResourceRegistry<T>
impl<T> ResourceRegistry<T>
Sourcepub fn register_tape(&mut self, name: impl Into<String>, tape: TapeLoop<T>)
pub fn register_tape(&mut self, name: impl Into<String>, tape: TapeLoop<T>)
Register a named tape loop, creating its writer/reader capability pair.
Sourcepub fn reader(&self, name: &str) -> Option<TapeReader<T>>
pub fn reader(&self, name: &str) -> Option<TapeReader<T>>
Acquire a read capability for the named tape (cloneable, many taps).
Sourcepub fn writer(&mut self, name: &str) -> Option<TapeWriter<T>>
pub fn writer(&mut self, name: &str) -> Option<TapeWriter<T>>
Acquire the unique write capability for the named tape.
Returns Some only on the first call for a given name; subsequent
calls return None. This enforces the single-writer invariant.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for ResourceRegistry<T>
impl<T> !Send for ResourceRegistry<T>
impl<T> !Sync for ResourceRegistry<T>
impl<T> !UnwindSafe for ResourceRegistry<T>
impl<T> Freeze for ResourceRegistry<T>
impl<T> Unpin for ResourceRegistry<T>
impl<T> UnsafeUnpin for ResourceRegistry<T>
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