pub struct DataspaceRegistry { /* private fields */ }Expand description
A dataspace registry for async coordination between processes.
The registry stores broadcast channels indexed by type and Identifier. Processes can subscribe to receive
assertion and retraction updates for a given type and identifier filter, and other processes can assert or retract
values that are delivered to all matching subscribers.
§Thread Safety
DataspaceRegistry is Clone and can be safely shared across threadVs and tasks. All operations are thread-safe.
Implementations§
Source§impl DataspaceRegistry
impl DataspaceRegistry
Sourcepub fn try_current() -> Option<Self>
pub fn try_current() -> Option<Self>
Returns the dataspace registry for the current supervision tree, if one exists.
Sourcepub fn with_channel_capacity(capacity: usize) -> Self
pub fn with_channel_capacity(capacity: usize) -> Self
Creates a new empty registry with the given channel capacity for broadcast channels.
Sourcepub fn assert<T>(&self, value: T, id: impl Into<Identifier>)
pub fn assert<T>(&self, value: T, id: impl Into<Identifier>)
Asserts a value with the given identifier, notifying all matching subscribers.
The assertion is automatically associated with the current process, and will be automatically retracted when that process exists. Only the owning process may update an existing assertion for a given type/identifier combination.
Sourcepub fn retract<T>(&self, id: impl Into<Identifier>)
pub fn retract<T>(&self, id: impl Into<Identifier>)
Retracts the value of the given type and identifier, notifying all matching subscribers.
Only the process that originally asserted the value may retract it.
Sourcepub fn subscribe<T>(&self, filter: IdentifierFilter) -> Subscription<T>
pub fn subscribe<T>(&self, filter: IdentifierFilter) -> Subscription<T>
Subscribes to assertion and retraction updates matching the given filter.
Returns a Subscription that can be used to asynchronously receive updates. Any assertions that match the
filter at the time of subscribing will be immediately yielded.
Trait Implementations§
Source§impl Clone for DataspaceRegistry
impl Clone for DataspaceRegistry
Source§fn clone(&self) -> DataspaceRegistry
fn clone(&self) -> DataspaceRegistry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for DataspaceRegistry
impl RefUnwindSafe for DataspaceRegistry
impl Send for DataspaceRegistry
impl Sync for DataspaceRegistry
impl Unpin for DataspaceRegistry
impl UnsafeUnpin for DataspaceRegistry
impl UnwindSafe for DataspaceRegistry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Track for T
impl<T> Track for T
§fn track_allocations(self, token: AllocationGroupToken) -> Tracked<Self>
fn track_allocations(self, token: AllocationGroupToken) -> Tracked<Self>
Tracked wrapper. Read more§fn in_current_allocation_group(self) -> Tracked<Self>
fn in_current_allocation_group(self) -> Tracked<Self>
Tracked wrapper. Read more