pub struct TagManager {
pub cache: RwLock<HashMap<String, TagMetadata>>,
pub udt_definitions: RwLock<HashMap<String, UdtDefinition>>,
/* private fields */
}Expand description
Manager for PLC tag discovery and caching
Fields§
§cache: RwLock<HashMap<String, TagMetadata>>Discovered tag metadata keyed by fully qualified symbolic name.
udt_definitions: RwLock<HashMap<String, UdtDefinition>>Discovered UDT definitions keyed by type name.
Implementations§
Source§impl TagManager
impl TagManager
Sourcepub async fn get_metadata(&self, tag_name: &str) -> Result<Option<TagMetadata>>
pub async fn get_metadata(&self, tag_name: &str) -> Result<Option<TagMetadata>>
Returns unexpired cached metadata for a tag.
Sourcepub async fn update_metadata(
&self,
tag_name: String,
metadata: TagMetadata,
) -> Result<()>
pub async fn update_metadata( &self, tag_name: String, metadata: TagMetadata, ) -> Result<()>
Inserts or replaces cached tag metadata.
Sourcepub async fn validate_tag(
&self,
tag_name: &str,
required_permissions: &TagPermissions,
) -> Result<()>
pub async fn validate_tag( &self, tag_name: &str, required_permissions: &TagPermissions, ) -> Result<()>
Validates that a cached tag grants the requested permissions.
Sourcepub async fn clear_cache(&self) -> Result<()>
pub async fn clear_cache(&self) -> Result<()>
Removes all cached tag metadata.
Sourcepub async fn remove_stale_entries(&self) -> Result<()>
pub async fn remove_stale_entries(&self) -> Result<()>
Removes metadata older than the configured cache duration.
Enumerates controller tags and refreshes the metadata cache.
Sourcepub async fn discover_udt_members(
&self,
client: &mut EipClient,
udt_name: &str,
) -> Result<Vec<(String, TagMetadata)>>
pub async fn discover_udt_members( &self, client: &mut EipClient, udt_name: &str, ) -> Result<Vec<(String, TagMetadata)>>
Discovers members of a UDT/structure
Sourcepub fn build_udt_definition_request(&self, _udt_name: &str) -> Result<Vec<u8>>
👎Deprecated since 1.2.0: This method fabricated an invalid UDT request. Use EipClient::get_udt_definition or EipClient::discover_udt_members instead. It will be removed in 2.0.
pub fn build_udt_definition_request(&self, _udt_name: &str) -> Result<Vec<u8>>
This method fabricated an invalid UDT request. Use EipClient::get_udt_definition or EipClient::discover_udt_members instead. It will be removed in 2.0.
Deprecated compatibility stub retained for 1.x SemVer.
Sourcepub fn parse_udt_definition_response(
&self,
_response: &[u8],
_udt_name: &str,
) -> Result<UdtDefinition>
👎Deprecated since 1.2.0: This method fabricated UDT members from arbitrary bytes. Use EipClient::get_udt_definition or EipClient::discover_udt_members instead. It will be removed in 2.0.
pub fn parse_udt_definition_response( &self, _response: &[u8], _udt_name: &str, ) -> Result<UdtDefinition>
This method fabricated UDT members from arbitrary bytes. Use EipClient::get_udt_definition or EipClient::discover_udt_members instead. It will be removed in 2.0.
Deprecated compatibility stub retained for 1.x SemVer.
Sourcepub fn get_udt_definition_cached(&self, udt_name: &str) -> Option<UdtDefinition>
pub fn get_udt_definition_cached(&self, udt_name: &str) -> Option<UdtDefinition>
Gets a cached UDT definition
Sourcepub fn list_udt_definitions(&self) -> Vec<String>
pub fn list_udt_definitions(&self) -> Vec<String>
Lists all cached UDT definitions
Sourcepub fn clear_udt_cache(&self)
pub fn clear_udt_cache(&self)
Clears UDT definition cache
Sourcepub fn parse_tag_list(
&self,
response: &[u8],
) -> Result<Vec<(String, TagMetadata)>>
pub fn parse_tag_list( &self, response: &[u8], ) -> Result<Vec<(String, TagMetadata)>>
Parses a Symbol Object enumeration response into named metadata entries.
Recursively drill down into UDT structures (similar to TypeScript drillDown function)