Skip to main content

BaoEvent

Enum BaoEvent 

Source
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

§request_id: String
§method: String
§headers: Value
§post_data: Option<String>
§resource_type: String
§

NetworkRequestWillBeSent

Fields

§request_id: String
§method: String
§headers: Value
§request: Value
§timestamp: f64
§resource_type: String
§

NetworkResponseReceived

Fields

§request_id: String
§status: i32
§status_text: String
§headers: Value
§timestamp: f64
§resource_type: String
§

NetworkLoadingFailed

Fields

§request_id: String
§resource_type: String
§error_text: String
§timestamp: f64
§

DebuggerScriptParsed

Fields

§script_id: String
§start_line: i32
§end_line: i32
§

DebuggerPaused

Fields

§call_frames: Value
§reason: String
§hit_breakpoints: Value
§

RuntimeExceptionThrown

Fields

§timestamp: f64
§text: String
§line: i32
§column: i32
§stack_trace: Value
§

PageLoadEventFired

Fields

§timestamp: f64
§

PageFrameNavigated

Fields

§frame_id: String
§loader_id: String
§

SecurityCertificateError

Fields

§event_id: i32
§error_type: String

Implementations§

Source§

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
Source§

impl BaoEvent

Broadcast a BaoEvent as the correct CDP event(s) through the EventSender. The JSON shapes exactly match the existing server.rs implementation (lines 140–254).

Source

pub fn broadcast(&self, sender: &dyn EventSender)

Trait Implementations§

Source§

impl Clone for BaoEvent

Source§

fn clone(&self) -> BaoEvent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BaoEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for BaoEvent

Source§

fn eq(&self, other: &BaoEvent) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for BaoEvent

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V