Skip to main content

ChannelManager

Struct ChannelManager 

Source
pub struct ChannelManager { /* private fields */ }
Expand description

Manages EPICS Channel Access + pvAccess connections and dispatches archived samples to storage.

Implementations§

Source§

impl ChannelManager

Source

pub async fn new( storage: Arc<dyn StoragePlugin>, registry: Arc<PvRegistry>, policy: Option<PolicyConfig>, ) -> Result<(Self, Receiver<PvSample>)>

Source

pub async fn new_with_drift( storage: Arc<dyn StoragePlugin>, registry: Arc<PvRegistry>, policy: Option<PolicyConfig>, server_ioc_drift_secs: u64, ) -> Result<(Self, Receiver<PvSample>)>

Construct with an explicit IOC drift bound. Java parity (6538631): keeps tests + sites that don’t surface EngineConfig on the existing default while letting the daemon plumb a configured value.

Source

pub async fn restore_from_registry(&self) -> Result<u64>

Restore all active PVs from the registry (called on startup).

pvs_by_status(Active) already filters out alias rows (they carry status='alias'), but we re-check alias_for.is_some() here so a future schema change can’t silently re-introduce double-archiving of the underlying IOC PV.

Source

pub async fn archive_pv( &self, pv_name: &str, sample_mode: &SampleMode, protocol: Protocol, ) -> Result<()>

Start archiving a new PV.

Source

pub async fn update_archive_fields( &self, pv_name: &str, fields: &[String], ) -> Result<()>

Replace the archive_fields list for a running PV. Cancels per-field monitor tasks for fields that left the set, spawns fresh ones for fields that joined, and leaves unchanged fields running. Serialised per-PV by an async mutex so concurrent callers can’t double-spawn. The main PV keeps running.

Source

pub async fn pause_pv(&self, pv_name: &str) -> Result<()>

Pause archiving for a PV.

Source

pub async fn resume_pv(&self, pv_name: &str) -> Result<()>

Resume a paused PV. Only paused or error PVs can be resumed; calling resume on an already-active PV is a no-op (returns Ok).

Source

pub async fn stop_pv(&self, pv_name: &str) -> Result<()>

Stop archiving a PV without removing it from the registry. Sets the PV status to Inactive (data retained, monitoring stopped).

Source

pub async fn destroy_pv(&self, pv_name: &str) -> Result<()>

Remove a PV from archiving entirely.

Source

pub fn list_pvs(&self) -> Vec<String>

List all currently archived PV names (from registry).

Source

pub fn matching_pvs(&self, pattern: &str) -> Vec<String>

Match PVs by glob pattern (from registry).

Source

pub fn registry(&self) -> &Arc<PvRegistry>

Get the registry reference.

Source

pub fn get_connection_info(&self, pv: &str) -> Option<ConnectionInfo>

Get connection info for a PV.

Source

pub fn get_never_connected_pvs(&self) -> Vec<String>

Get PV names that have never received any event (connected_since == None).

Source

pub fn pv_counters(&self, pv_name: &str) -> Option<Arc<PvCounters>>

Snapshot the diagnostic counters for one PV. Returns None if the PV isn’t actively archived. The returned Arc is the live counter — callers read with Ordering::Relaxed.

Source

pub fn all_pv_counters(&self) -> Vec<(String, PvCountersSnapshot)>

Snapshot every active PV’s counters. Returns (pv_name, PvCountersSnapshot) so callers don’t have to handle Arc.

Source

pub async fn live_value( &self, pv_name: &str, timeout: Duration, ) -> Option<Result<ArchiverValue>>

One-shot CA get against the running channel for pv. Returns None if the PV isn’t actively archived. The timeout caps how long the caller will wait for a value when the IOC is slow. Powers getEngineDataAction / getDataAtTimeEngine.

Source

pub fn extras_snapshot(&self, pv_name: &str) -> HashMap<String, String>

Snapshot the latest cached extra-field values for pv(field_name, stringified_value) pairs. Empty map when the PV isn’t archived or has no archive_fields configured.

Source

pub fn get_currently_disconnected_pvs(&self) -> Vec<String>

Get PV names that are currently disconnected (is_connected == false).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more