forked from rust-headless-chrome/rust-headless-chrome
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Tab.get_script_source and enable / disable debugger methods (rust…
- Loading branch information
Showing
6 changed files
with
167 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
pub mod methods { | ||
use crate::protocol::Method; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Serialize, Debug, Default)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct GetScriptSource<'a> { | ||
pub script_id: &'a str, | ||
} | ||
#[derive(Debug, Deserialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct GetScriptSourceReturnObject { | ||
pub script_source: String, | ||
} | ||
impl<'a> Method for GetScriptSource<'a> { | ||
const NAME: &'static str = "Debugger.getScriptSource"; | ||
type ReturnObject = GetScriptSourceReturnObject; | ||
} | ||
|
||
#[derive(Serialize, Debug)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct Enable {} | ||
#[derive(Debug, Deserialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct EnableReturnObject {} | ||
impl Method for Enable { | ||
const NAME: &'static str = "Debugger.enable"; | ||
type ReturnObject = EnableReturnObject; | ||
} | ||
|
||
#[derive(Serialize, Debug)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct Disable {} | ||
#[derive(Debug, Deserialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct DisableReturnObject {} | ||
impl Method for Disable { | ||
const NAME: &'static str = "Debugger.disable"; | ||
type ReturnObject = DisableReturnObject; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters