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 an ordinary source. Sources may shadow stores and each other.
Lower order values are queried first.
Sourcepub async fn add_store(
&self,
label: impl Into<String>,
order: i32,
source: Arc<dyn Source>,
)
pub async fn add_store( &self, label: impl Into<String>, order: i32, source: Arc<dyn Source>, )
Register a store — a source whose record set is fixed and must not
overlap another store’s. See StoreSource.
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.