ih_muse::prelude

Struct State

Source
pub struct State { /* private fields */ }

Implementations§

Source§

impl State

Source

pub fn new(default_resolution: TimestampResolution) -> State

Source

pub async fn update_nodes(&self, new_nodes: HashMap<Uuid, NodeInfo>)

Update the nodes

Source

pub async fn get_nodes(&self) -> HashMap<Uuid, NodeInfo>

Source

pub async fn init_element_kinds( &self, element_kinds: &[ElementKindRegistration], )

Inits element_kinds only once. Subsequent calls will return an error.

Source

pub fn is_valid_element_kind_code(&self, element_kind_code: &str) -> bool

Check if an element kind code is valid.

Source

pub async fn init_metrics(&self, metric_definitions: &[MetricDefinition])

Inits registered_metrics only once. Subsequent calls will return an error.

Source

pub fn is_valid_metric_code(&self, metric_code: &str) -> bool

Check if a metric code is valid.

Source

pub async fn update_metric_order(&self, metric_order: Vec<MetricDefinition>)

Update metric_order atomically with a new order. ! This is only updated in one tasks, no concurrency issues

  • It can safely being read from multiple threads
Source

pub fn get_metric_order(&self) -> Arc<Vector<Arc<MetricDefinition>>>

Returns a reference to the ordered metric definitions as a slice.

Source

pub async fn update_min_max_element_id(&self, element_id: u64)

Updates min_element_id and max_element_id based on the provided element_id. If either is None, it will set both to the element_id. Otherwise, it updates min_element_id if element_id is smaller, and max_element_id if element_id is larger.

Source

pub async fn get_element_id_range(&self) -> (Option<u64>, Option<u64>)

Source

pub async fn update_node_elem_ranges(&self, ranges: &[NodeElementRange])

Source

pub async fn get_node_elem_ranges(&self) -> OrdMap<OrdRangeInc, Uuid>

Source

pub fn find_node(&self, element_id: u64) -> Option<Uuid>

Find the node ID corresponding to a given element ID

Source

pub fn find_element_node_addr(&self, element_id: u64) -> Option<SocketAddr>

Find the node address corresponding to a given element ID

Source

pub async fn update_finest_resolution( &self, finest_resolution: TimestampResolution, )

Update finest_resolution atomically.

Source

pub fn get_finest_resolution(&self) -> TimestampResolution

Retrieve the current finest_resolution as TimestampResolution.

Source

pub async fn update_element_id(&self, local_id: Uuid, element_id: u64)

Source

pub fn get_element_id(&self, local_id: &Uuid) -> Option<u64>

Trait Implementations§

Source§

impl Default for State

Source§

fn default() -> State

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl !Freeze for State

§

impl RefUnwindSafe for State

§

impl Send for State

§

impl Sync for State

§

impl Unpin for State

§

impl UnwindSafe for State

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T