pub enum RegistryEvent {
Register {
type_name: &'static str,
},
RegisterCompleted {
type_name: &'static str,
},
Get {
type_name: &'static str,
found: bool,
},
Contains {
type_name: &'static str,
found: bool,
},
Clear {},
}Expand description
Events emitted by the registry during operations.
These events are passed to the tracing callback set via set_trace_callback.
The Clone derive allows callbacks to store or forward events if needed.
For register, two events are emitted per call: Register fires before the
value is stored (so a panic during storage is visible in the log), and
RegisterCompleted fires after the value is successfully stored. If only
Register appears without a following RegisterCompleted, the store panicked.
§Examples
use singleton_registry::RegistryEvent;
let event = RegistryEvent::Register { type_name: "i32" };
assert_eq!(event.to_string(), "register { type_name: i32 }");Variants§
Register
A register call was received. Fires before the value is stored.
Followed by RegisterCompleted on success.
Fields
RegisterCompleted
A value was successfully stored in the registry. Fires after the insert.
Get
A value was requested from the registry.
Fields
Contains
A type existence check was performed.
Fields
Clear
The registry was cleared.
Trait Implementations§
Source§impl Clone for RegistryEvent
impl Clone for RegistryEvent
Source§fn clone(&self) -> RegistryEvent
fn clone(&self) -> RegistryEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more