pub enum BaoEvent {
FetchRequestPaused {
request_id: String,
url: String,
method: String,
headers: Value,
post_data: Option<String>,
resource_type: String,
},
NetworkRequestWillBeSent {
request_id: String,
url: String,
method: String,
headers: Value,
request: Value,
timestamp: f64,
resource_type: String,
},
NetworkResponseReceived {
request_id: String,
url: String,
status: i32,
status_text: String,
headers: Value,
timestamp: f64,
resource_type: String,
},
NetworkLoadingFailed {
request_id: String,
resource_type: String,
error_text: String,
timestamp: f64,
},
DebuggerScriptParsed {
script_id: String,
url: String,
start_line: i32,
end_line: i32,
},
DebuggerPaused {
call_frames: Value,
reason: String,
hit_breakpoints: Value,
},
RuntimeExceptionThrown {
timestamp: f64,
text: String,
url: String,
line: i32,
column: i32,
stack_trace: Value,
},
PageLoadEventFired {
timestamp: f64,
},
PageFrameNavigated {
frame_id: String,
url: String,
loader_id: String,
},
SecurityCertificateError {
event_id: i32,
error_type: String,
url: String,
},
}Expand description
Typed representation of CDP events that originate from the browser engine (servo/bao_browser) and are forwarded to cdp-server via console messages.
The old protocol used 8 different __BAO_*__ string prefixes. This enum
replaces that with a single standardized transport format:
__BAO_EVT__CDP.MethodName\n{json}Variants§
FetchRequestPaused
Fields
NetworkRequestWillBeSent
Fields
NetworkResponseReceived
Fields
NetworkLoadingFailed
DebuggerScriptParsed
DebuggerPaused
RuntimeExceptionThrown
PageLoadEventFired
SecurityCertificateError
Implementations§
Source§impl BaoEvent
Parse a console text string into a ConsoleMessage.
impl BaoEvent
Parse a console text string into a ConsoleMessage.
Transport format for events:
__BAO_EVT__CDP.MethodName\n{json}- Lines without the
__BAO_EVT__prefix →ConsoleMessage::Log - Lines with unknown CDP method →
None - Malformed JSON → best-effort parse with defaults
- Missing newline → treat everything after the prefix as JSON
pub fn from_console_text(text: &str) -> Option<ConsoleMessage>
Trait Implementations§
impl StructuralPartialEq for BaoEvent
Auto Trait Implementations§
impl Freeze for BaoEvent
impl RefUnwindSafe for BaoEvent
impl Send for BaoEvent
impl Sync for BaoEvent
impl Unpin for BaoEvent
impl UnsafeUnpin for BaoEvent
impl UnwindSafe for BaoEvent
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