pub struct SourceRegistry { /* private fields */ }Expand description
A dynamic, priority-ordered registry of Source providers.
PV name resolution iterates sources from lowest order to highest and
delegates to the first source that claims the name.
Implementations§
Source§impl SourceRegistry
impl SourceRegistry
Sourcepub async fn add(
&self,
label: impl Into<String>,
order: i32,
source: Arc<dyn Source>,
)
pub async fn add( &self, label: impl Into<String>, order: i32, source: Arc<dyn Source>, )
Register a new source at the given priority.
Lower order values are queried first.
Sourcepub async fn claim(&self, name: &str) -> Option<PvInfo>
pub async fn claim(&self, name: &str) -> Option<PvInfo>
Find the first source that claims name and return its metadata.
Sourcepub async fn has_pv(&self, name: &str) -> bool
pub async fn has_pv(&self, name: &str) -> bool
Check whether any source claims the given PV name.
Sourcepub async fn get(&self, name: &str) -> Option<NtPayload>
pub async fn get(&self, name: &str) -> Option<NtPayload>
Get the value from the first source that claims the PV.
Sourcepub async fn get_descriptor(&self, name: &str) -> Option<StructureDesc>
pub async fn get_descriptor(&self, name: &str) -> Option<StructureDesc>
Get the structure descriptor from the first source that claims the PV.
Sourcepub async fn is_writable(&self, name: &str) -> bool
pub async fn is_writable(&self, name: &str) -> bool
Check if the PV is writable (via the first claiming source).
Sourcepub async fn put(
&self,
name: &str,
value: &DecodedValue,
) -> Result<Vec<(String, NtPayload)>, String>
pub async fn put( &self, name: &str, value: &DecodedValue, ) -> Result<Vec<(String, NtPayload)>, String>
Delegate a PUT to the first source that claims the PV.
Sourcepub async fn subscribe(&self, name: &str) -> Option<Receiver<NtPayload>>
pub async fn subscribe(&self, name: &str) -> Option<Receiver<NtPayload>>
Subscribe via the first source that claims the PV.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SourceRegistry
impl !RefUnwindSafe for SourceRegistry
impl !UnwindSafe for SourceRegistry
impl Send for SourceRegistry
impl Sync for SourceRegistry
impl Unpin for SourceRegistry
impl UnsafeUnpin for SourceRegistry
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