#[non_exhaustive]pub enum AppEvent {
Ipc(IpcCall),
#[non_exhaustive] StateChange {
key: String,
timestamp: DateTime<Utc>,
caused_by: Option<String>,
},
#[non_exhaustive] DomMutation {
webview_label: String,
timestamp: DateTime<Utc>,
mutation_count: u32,
},
#[non_exhaustive] DomInteraction {
action: InteractionKind,
selector: String,
value: Option<String>,
timestamp: DateTime<Utc>,
webview_label: String,
},
#[non_exhaustive] WindowEvent {
label: String,
event: String,
timestamp: DateTime<Utc>,
},
#[non_exhaustive] Console {
level: String,
message: String,
timestamp: DateTime<Utc>,
},
}Expand description
Application event captured by the introspection layer.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Ipc(IpcCall)
An IPC call between webview and Rust backend.
#[non_exhaustive]StateChange
A change to application state in the backend.
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
#[non_exhaustive]DomMutation
A batch of DOM mutations observed in a webview.
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
#[non_exhaustive]DomInteraction
A user interaction captured from the DOM during recording.
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§
action: InteractionKindWhat kind of interaction occurred.
#[non_exhaustive]WindowEvent
A native window lifecycle event (e.g. focus, resize, close).
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
#[non_exhaustive]Console
A console log/warn/error message captured from the webview.
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
Implementations§
Source§impl AppEvent
impl AppEvent
Sourcepub fn state_change(
key: impl Into<String>,
timestamp: DateTime<Utc>,
caused_by: Option<String>,
) -> Self
pub fn state_change( key: impl Into<String>, timestamp: DateTime<Utc>, caused_by: Option<String>, ) -> Self
Builds an AppEvent::StateChange.
Sourcepub fn dom_mutation(
webview_label: impl Into<String>,
timestamp: DateTime<Utc>,
mutation_count: u32,
) -> Self
pub fn dom_mutation( webview_label: impl Into<String>, timestamp: DateTime<Utc>, mutation_count: u32, ) -> Self
Builds an AppEvent::DomMutation.
Sourcepub fn dom_interaction(
action: InteractionKind,
selector: impl Into<String>,
value: Option<String>,
timestamp: DateTime<Utc>,
webview_label: impl Into<String>,
) -> Self
pub fn dom_interaction( action: InteractionKind, selector: impl Into<String>, value: Option<String>, timestamp: DateTime<Utc>, webview_label: impl Into<String>, ) -> Self
Builds an AppEvent::DomInteraction.
Sourcepub fn window_event(
label: impl Into<String>,
event: impl Into<String>,
timestamp: DateTime<Utc>,
) -> Self
pub fn window_event( label: impl Into<String>, event: impl Into<String>, timestamp: DateTime<Utc>, ) -> Self
Builds an AppEvent::WindowEvent.
Sourcepub fn console(
level: impl Into<String>,
message: impl Into<String>,
timestamp: DateTime<Utc>,
) -> Self
pub fn console( level: impl Into<String>, message: impl Into<String>, timestamp: DateTime<Utc>, ) -> Self
Builds an AppEvent::Console.
§Examples
use victauri_core::AppEvent;
let ev = AppEvent::console("warn", "deprecated", chrono::Utc::now());
assert!(matches!(ev, AppEvent::Console { .. }));Sourcepub fn timestamp(&self) -> DateTime<Utc>
pub fn timestamp(&self) -> DateTime<Utc>
Returns the timestamp of this event, regardless of variant.
Sourcepub fn is_internal(&self) -> bool
pub fn is_internal(&self) -> bool
Returns true if this event was generated by Victauri’s own infrastructure rather than the application under observation.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AppEvent
impl<'de> Deserialize<'de> for AppEvent
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for AppEvent
impl StructuralPartialEq for AppEvent
Auto Trait Implementations§
impl Freeze for AppEvent
impl RefUnwindSafe for AppEvent
impl Send for AppEvent
impl Sync for AppEvent
impl Unpin for AppEvent
impl UnsafeUnpin for AppEvent
impl UnwindSafe for AppEvent
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
Mutably borrows from an owned value. Read more