pub struct ConfigObjectMap<T: ConfigObject> { /* private fields */ }Expand description
A map of objects implementing the ConfigObject trait.
This struct provides a container for storing and managing a collection of objects, each of which
implements the ConfigObject trait. It uses a HashMap to maintain a mapping between object
names and the objects themselves, facilitating efficient retrieval and management.
§Type Parameters
T- The type of the objects stored in the map. Must implement theConfigObjectandClonetraits.
§Fields
objects- AHashMapwhere keys are object names and values areArc<T>.
Implementations§
Source§impl<T: ConfigObject + Clone> ConfigObjectMap<T>
impl<T: ConfigObject + Clone> ConfigObjectMap<T>
Sourcepub fn iter_cloned(&self) -> impl Iterator<Item = T> + '_
pub fn iter_cloned(&self) -> impl Iterator<Item = T> + '_
Creates an iterator over cloned objects in the collection.
Source§impl<T: ConfigObject> ConfigObjectMap<T>
impl<T: ConfigObject> ConfigObjectMap<T>
Sourcepub fn add(&mut self, object: T)
pub fn add(&mut self, object: T)
Adds an object to the collection using the object’s unique name as the key.
The unique name is retrieved by calling the unique_name() method on the object.
Sourcepub fn add_ref(&mut self, object: Arc<T>)
pub fn add_ref(&mut self, object: Arc<T>)
Adds a reference to an object to the collection using the object’s unique name as the key.
This method is used to add objects that are already wrapped in Arc<T>.
§Arguments
object- AnArc<T>reference to the object to add.
Sourcepub fn as_vec(&self) -> Vec<Arc<T>>
pub fn as_vec(&self) -> Vec<Arc<T>>
Creates a representation of the collection as a Vec of Arc<T>.
Sourcepub fn insert(&mut self, key: String, object: Arc<T>)
pub fn insert(&mut self, key: String, object: Arc<T>)
Inserts an object into the collection without checking for duplicates.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Checks whether the collection is empty.
§Returns
A boolean indicating whether the collection is empty.
Sourcepub fn iter(&self) -> Iter<'_, String, Arc<T>>
pub fn iter(&self) -> Iter<'_, String, Arc<T>>
Retrieves an iterator over references to the objects in the collection.
§Returns
An iterator over items in the collection in arbitrary order.
Sourcepub fn keys(&self) -> Keys<'_, String, Arc<T>>
pub fn keys(&self) -> Keys<'_, String, Arc<T>>
Retrieves an iterator over the keys in the collection.
§Returns
An iterator over the keys in the collection in arbitrary order.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Calculates the number of objects in the collection.
§Returns
The number of objects in the collection as a usize.
Sourcepub fn values(&self) -> impl Iterator<Item = &Arc<T>>
pub fn values(&self) -> impl Iterator<Item = &Arc<T>>
Retrieves an iterator over references to the objects in the collection.
§Returns
An iterator over references to the objects in the collection.
pub fn drain(&mut self) -> Drain<'_, String, Arc<T>>
pub fn extend(&mut self, other: &mut Self)
Trait Implementations§
Source§impl<T: Clone + ConfigObject> Clone for ConfigObjectMap<T>
impl<T: Clone + ConfigObject> Clone for ConfigObjectMap<T>
Source§fn clone(&self) -> ConfigObjectMap<T>
fn clone(&self) -> ConfigObjectMap<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T: Debug + ConfigObject> Debug for ConfigObjectMap<T>
impl<T: Debug + ConfigObject> Debug for ConfigObjectMap<T>
Source§impl<T: Default + ConfigObject> Default for ConfigObjectMap<T>
impl<T: Default + ConfigObject> Default for ConfigObjectMap<T>
Source§fn default() -> ConfigObjectMap<T>
fn default() -> ConfigObjectMap<T>
Source§impl<'de, T: ConfigObject> Deserialize<'de> for ConfigObjectMap<T>
impl<'de, T: ConfigObject> Deserialize<'de> for ConfigObjectMap<T>
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl From<&ConfigObjectMap<BSMComponent>> for ConfigRefMap<BSMComponentRef>
impl From<&ConfigObjectMap<BSMComponent>> for ConfigRefMap<BSMComponentRef>
Source§fn from(components: &ConfigObjectMap<BSMComponent>) -> Self
fn from(components: &ConfigObjectMap<BSMComponent>) -> Self
Source§impl From<&ConfigObjectMap<BSMService>> for ConfigRefMap<BSMServiceRef>
impl From<&ConfigObjectMap<BSMService>> for ConfigRefMap<BSMServiceRef>
Source§fn from(services: &ConfigObjectMap<BSMService>) -> Self
fn from(services: &ConfigObjectMap<BSMService>) -> Self
Source§impl From<&ConfigObjectMap<Contact>> for ConfigRefMap<ContactRef>
impl From<&ConfigObjectMap<Contact>> for ConfigRefMap<ContactRef>
Source§fn from(contacts: &ConfigObjectMap<Contact>) -> Self
fn from(contacts: &ConfigObjectMap<Contact>) -> Self
Source§impl From<&ConfigObjectMap<Hashtag>> for ConfigRefMap<HashtagRef>
impl From<&ConfigObjectMap<Hashtag>> for ConfigRefMap<HashtagRef>
Source§fn from(hashtags: &ConfigObjectMap<Hashtag>) -> Self
fn from(hashtags: &ConfigObjectMap<Hashtag>) -> Self
Source§impl From<&ConfigObjectMap<Host>> for ConfigRefMap<HostRef>
impl From<&ConfigObjectMap<Host>> for ConfigRefMap<HostRef>
Source§fn from(hosts: &ConfigObjectMap<Host>) -> Self
fn from(hosts: &ConfigObjectMap<Host>) -> Self
Source§impl From<&ConfigObjectMap<HostCheckCommand>> for ConfigRefMap<HostCheckCommandRef>
impl From<&ConfigObjectMap<HostCheckCommand>> for ConfigRefMap<HostCheckCommandRef>
Source§fn from(check_commands: &ConfigObjectMap<HostCheckCommand>) -> Self
fn from(check_commands: &ConfigObjectMap<HostCheckCommand>) -> Self
Source§impl From<&ConfigObjectMap<HostGroup>> for ConfigRefMap<HostGroupRef>
impl From<&ConfigObjectMap<HostGroup>> for ConfigRefMap<HostGroupRef>
Source§fn from(host_groups: &ConfigObjectMap<HostGroup>) -> Self
fn from(host_groups: &ConfigObjectMap<HostGroup>) -> Self
Source§impl From<&ConfigObjectMap<HostTemplate>> for ConfigRefMap<HostTemplateRef>
impl From<&ConfigObjectMap<HostTemplate>> for ConfigRefMap<HostTemplateRef>
Source§fn from(host_templates: &ConfigObjectMap<HostTemplate>) -> Self
fn from(host_templates: &ConfigObjectMap<HostTemplate>) -> Self
Source§impl From<&ConfigObjectMap<MonitoringCluster>> for ConfigRefMap<MonitoringClusterRef>
impl From<&ConfigObjectMap<MonitoringCluster>> for ConfigRefMap<MonitoringClusterRef>
Source§fn from(clusters: &ConfigObjectMap<MonitoringCluster>) -> Self
fn from(clusters: &ConfigObjectMap<MonitoringCluster>) -> Self
Source§impl From<&ConfigObjectMap<NotificationMethod>> for ConfigRefMap<NotificationMethodRef>
impl From<&ConfigObjectMap<NotificationMethod>> for ConfigRefMap<NotificationMethodRef>
Source§fn from(methods: &ConfigObjectMap<NotificationMethod>) -> Self
fn from(methods: &ConfigObjectMap<NotificationMethod>) -> Self
Source§impl From<&ConfigObjectMap<NotificationProfile>> for ConfigRefMap<NotificationProfileRef>
impl From<&ConfigObjectMap<NotificationProfile>> for ConfigRefMap<NotificationProfileRef>
Source§fn from(profiles: &ConfigObjectMap<NotificationProfile>) -> Self
fn from(profiles: &ConfigObjectMap<NotificationProfile>) -> Self
Source§impl From<&ConfigObjectMap<Role>> for ConfigRefMap<RoleRef>
impl From<&ConfigObjectMap<Role>> for ConfigRefMap<RoleRef>
Source§fn from(roles: &ConfigObjectMap<Role>) -> Self
fn from(roles: &ConfigObjectMap<Role>) -> Self
Source§impl From<&ConfigObjectMap<ServiceCheck>> for ConfigRefMap<ServiceCheckHostRef>
impl From<&ConfigObjectMap<ServiceCheck>> for ConfigRefMap<ServiceCheckHostRef>
Source§fn from(servicechecks: &ConfigObjectMap<ServiceCheck>) -> Self
fn from(servicechecks: &ConfigObjectMap<ServiceCheck>) -> Self
Source§impl From<&ConfigObjectMap<ServiceCheck>> for ConfigRefMap<ServiceCheckRef>
impl From<&ConfigObjectMap<ServiceCheck>> for ConfigRefMap<ServiceCheckRef>
Source§fn from(servicechecks: &ConfigObjectMap<ServiceCheck>) -> Self
fn from(servicechecks: &ConfigObjectMap<ServiceCheck>) -> Self
Source§impl From<&ConfigObjectMap<ServiceGroup>> for ConfigRefMap<ServiceGroupRef>
impl From<&ConfigObjectMap<ServiceGroup>> for ConfigRefMap<ServiceGroupRef>
Source§fn from(groups: &ConfigObjectMap<ServiceGroup>) -> Self
fn from(groups: &ConfigObjectMap<ServiceGroup>) -> Self
Source§fn from(profiles: &ConfigObjectMap<SharedNotificationProfile>) -> Self
fn from(profiles: &ConfigObjectMap<SharedNotificationProfile>) -> Self
Source§impl From<&ConfigObjectMap<Tenancy>> for ConfigRefMap<TenancyRef>
impl From<&ConfigObjectMap<Tenancy>> for ConfigRefMap<TenancyRef>
Source§fn from(tenancies: &ConfigObjectMap<Tenancy>) -> Self
fn from(tenancies: &ConfigObjectMap<Tenancy>) -> Self
Source§impl From<&ConfigObjectMap<TimePeriod>> for ConfigRefMap<TimePeriodRef>
impl From<&ConfigObjectMap<TimePeriod>> for ConfigRefMap<TimePeriodRef>
Source§fn from(timeperiods: &ConfigObjectMap<TimePeriod>) -> Self
fn from(timeperiods: &ConfigObjectMap<TimePeriod>) -> Self
Source§impl From<&ConfigObjectMap<Variable>> for ConfigRefMap<HostVariableRef>
impl From<&ConfigObjectMap<Variable>> for ConfigRefMap<HostVariableRef>
Source§fn from(variables: &ConfigObjectMap<Variable>) -> Self
fn from(variables: &ConfigObjectMap<Variable>) -> Self
Source§impl From<&ConfigObjectMap<Variable>> for ConfigRefMap<VariableRef>
impl From<&ConfigObjectMap<Variable>> for ConfigRefMap<VariableRef>
Source§fn from(variables: &ConfigObjectMap<Variable>) -> Self
fn from(variables: &ConfigObjectMap<Variable>) -> Self
Source§impl From<&ConfigObjectMap<Variable>> for ConfigRefMap<VariableValueRef>
impl From<&ConfigObjectMap<Variable>> for ConfigRefMap<VariableValueRef>
Source§fn from(variables: &ConfigObjectMap<Variable>) -> Self
fn from(variables: &ConfigObjectMap<Variable>) -> Self
Source§impl<T: ConfigObject> FromIterator<T> for ConfigObjectMap<T>
impl<T: ConfigObject> FromIterator<T> for ConfigObjectMap<T>
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Source§impl<T: PartialEq + ConfigObject> PartialEq for ConfigObjectMap<T>
impl<T: PartialEq + ConfigObject> PartialEq for ConfigObjectMap<T>
Source§impl PersistentMap for ConfigObjectMap<BSMComponent>
impl PersistentMap for ConfigObjectMap<BSMComponent>
fn config_path() -> Option<String>
async fn create_all( &self, client: &OpsviewClient, ) -> Result<Value, OpsviewClientError>
Source§impl PersistentMap for ConfigObjectMap<BSMService>
impl PersistentMap for ConfigObjectMap<BSMService>
fn config_path() -> Option<String>
async fn create_all( &self, client: &OpsviewClient, ) -> Result<Value, OpsviewClientError>
Source§impl PersistentMap for ConfigObjectMap<Contact>
impl PersistentMap for ConfigObjectMap<Contact>
fn config_path() -> Option<String>
async fn create_all( &self, client: &OpsviewClient, ) -> Result<Value, OpsviewClientError>
Source§impl PersistentMap for ConfigObjectMap<Hashtag>
impl PersistentMap for ConfigObjectMap<Hashtag>
fn config_path() -> Option<String>
async fn create_all( &self, client: &OpsviewClient, ) -> Result<Value, OpsviewClientError>
Source§impl PersistentMap for ConfigObjectMap<Host>
impl PersistentMap for ConfigObjectMap<Host>
fn config_path() -> Option<String>
async fn create_all( &self, client: &OpsviewClient, ) -> Result<Value, OpsviewClientError>
Source§impl PersistentMap for ConfigObjectMap<HostCheckCommand>
impl PersistentMap for ConfigObjectMap<HostCheckCommand>
fn config_path() -> Option<String>
async fn create_all( &self, client: &OpsviewClient, ) -> Result<Value, OpsviewClientError>
Source§impl PersistentMap for ConfigObjectMap<HostGroup>
impl PersistentMap for ConfigObjectMap<HostGroup>
fn config_path() -> Option<String>
async fn create_all( &self, client: &OpsviewClient, ) -> Result<Value, OpsviewClientError>
Source§impl PersistentMap for ConfigObjectMap<HostIcon>
impl PersistentMap for ConfigObjectMap<HostIcon>
fn config_path() -> Option<String>
async fn create_all( &self, client: &OpsviewClient, ) -> Result<Value, OpsviewClientError>
Source§impl PersistentMap for ConfigObjectMap<HostTemplate>
impl PersistentMap for ConfigObjectMap<HostTemplate>
fn config_path() -> Option<String>
async fn create_all( &self, client: &OpsviewClient, ) -> Result<Value, OpsviewClientError>
Source§impl PersistentMap for ConfigObjectMap<MonitoringCluster>
impl PersistentMap for ConfigObjectMap<MonitoringCluster>
fn config_path() -> Option<String>
async fn create_all( &self, client: &OpsviewClient, ) -> Result<Value, OpsviewClientError>
Source§impl PersistentMap for ConfigObjectMap<MonitoringServer>
impl PersistentMap for ConfigObjectMap<MonitoringServer>
fn config_path() -> Option<String>
async fn create_all( &self, client: &OpsviewClient, ) -> Result<Value, OpsviewClientError>
Source§impl PersistentMap for ConfigObjectMap<NetflowCollector>
impl PersistentMap for ConfigObjectMap<NetflowCollector>
fn config_path() -> Option<String>
async fn create_all( &self, client: &OpsviewClient, ) -> Result<Value, OpsviewClientError>
Source§impl PersistentMap for ConfigObjectMap<NetflowSource>
impl PersistentMap for ConfigObjectMap<NetflowSource>
fn config_path() -> Option<String>
async fn create_all( &self, client: &OpsviewClient, ) -> Result<Value, OpsviewClientError>
Source§impl PersistentMap for ConfigObjectMap<NotificationMethod>
impl PersistentMap for ConfigObjectMap<NotificationMethod>
fn config_path() -> Option<String>
async fn create_all( &self, client: &OpsviewClient, ) -> Result<Value, OpsviewClientError>
Source§impl PersistentMap for ConfigObjectMap<NotificationProfile>
impl PersistentMap for ConfigObjectMap<NotificationProfile>
fn config_path() -> Option<String>
async fn create_all( &self, client: &OpsviewClient, ) -> Result<Value, OpsviewClientError>
Source§impl PersistentMap for ConfigObjectMap<Role>
impl PersistentMap for ConfigObjectMap<Role>
fn config_path() -> Option<String>
async fn create_all( &self, client: &OpsviewClient, ) -> Result<Value, OpsviewClientError>
Source§impl PersistentMap for ConfigObjectMap<ServiceCheck>
impl PersistentMap for ConfigObjectMap<ServiceCheck>
fn config_path() -> Option<String>
async fn create_all( &self, client: &OpsviewClient, ) -> Result<Value, OpsviewClientError>
Source§impl PersistentMap for ConfigObjectMap<ServiceGroup>
impl PersistentMap for ConfigObjectMap<ServiceGroup>
fn config_path() -> Option<String>
async fn create_all( &self, client: &OpsviewClient, ) -> Result<Value, OpsviewClientError>
fn config_path() -> Option<String>
async fn create_all( &self, client: &OpsviewClient, ) -> Result<Value, OpsviewClientError>
Source§impl PersistentMap for ConfigObjectMap<Tenancy>
impl PersistentMap for ConfigObjectMap<Tenancy>
fn config_path() -> Option<String>
async fn create_all( &self, client: &OpsviewClient, ) -> Result<Value, OpsviewClientError>
Source§impl PersistentMap for ConfigObjectMap<TimePeriod>
impl PersistentMap for ConfigObjectMap<TimePeriod>
fn config_path() -> Option<String>
async fn create_all( &self, client: &OpsviewClient, ) -> Result<Value, OpsviewClientError>
Source§impl PersistentMap for ConfigObjectMap<Variable>
impl PersistentMap for ConfigObjectMap<Variable>
fn config_path() -> Option<String>
async fn create_all( &self, client: &OpsviewClient, ) -> Result<Value, OpsviewClientError>
Source§impl<T: ConfigObject> Serialize for ConfigObjectMap<T>
impl<T: ConfigObject> Serialize for ConfigObjectMap<T>
impl<T: Eq + ConfigObject> Eq for ConfigObjectMap<T>
impl<T: ConfigObject> StructuralPartialEq for ConfigObjectMap<T>
Auto Trait Implementations§
impl<T> Freeze for ConfigObjectMap<T>
impl<T> RefUnwindSafe for ConfigObjectMap<T>where
T: RefUnwindSafe,
impl<T> Send for ConfigObjectMap<T>
impl<T> Sync for ConfigObjectMap<T>
impl<T> Unpin for ConfigObjectMap<T>
impl<T> UnwindSafe for ConfigObjectMap<T>where
T: RefUnwindSafe,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.