pub struct DltApplication { /* private fields */ }Expand description
Singleton guard for DLT application registration
Only one DLT application can be registered per process. Automatically unregistered when dropped and a new application can be registered.
Lifetime Guarantee: Contexts maintain an internal reference, keeping the application registered. Safe to drop the application handle before contexts.
Cheaply cloneable for sharing across threads
Implementations§
Source§impl DltApplication
impl DltApplication
Sourcepub fn register(app_id: &DltId, app_description: &str) -> Result<Self, DltError>
pub fn register(app_id: &DltId, app_description: &str) -> Result<Self, DltError>
Register a DLT application
Only one application can be registered per process. If you need to register a different application, drop this instance first.
The returned handle can be cloned to share the application across threads.
§Errors
Returns DltError if the registration fails
Sourcepub fn create_context(
&self,
context_id: &DltId,
context_description: &str,
) -> Result<DltContextHandle, DltError>
pub fn create_context( &self, context_id: &DltId, context_description: &str, ) -> Result<DltContextHandle, DltError>
Create a new DLT context within this application
The created context maintains an internal reference to the application, ensuring the application remains registered as long as the context exists.
§Errors
Returns DltError if registration fails