pub struct ScriptRet { /* private fields */ }
Expand description
Helper struct for getting return values from scripts.
See the examples for WebDriver::execute
and WebDriver::execute_async
.
Implementations§
Source§impl ScriptRet
impl ScriptRet
Sourcepub fn new(handle: SessionHandle, value: Value) -> Self
pub fn new(handle: SessionHandle, value: Value) -> Self
Create a new ScriptRet.
This is typically done automatically via WebDriver::execute
or WebDriver::execute_async
.
pub fn value(&self) -> &Value
👎Deprecated since 0.30.0: This method has been renamed to json()
pub fn convert<T>(&self) -> WebDriverResult<T>where
T: DeserializeOwned,
Sourcepub fn element(self) -> WebDriverResult<WebElement>
pub fn element(self) -> WebDriverResult<WebElement>
Get a single WebElement return value.
Your script must return only a single element for this to work.
pub fn get_element(self) -> WebDriverResult<WebElement>
👎Deprecated since 0.30.0: This method has been renamed to element()
Sourcepub fn elements(self) -> WebDriverResult<Vec<WebElement>>
pub fn elements(self) -> WebDriverResult<Vec<WebElement>>
Get a vec of WebElements from the return value.
Your script must return an array of elements for this to work.
pub fn get_elements(self) -> WebDriverResult<Vec<WebElement>>
👎Deprecated since 0.30.0: This method has been renamed to elements()
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ScriptRet
impl !RefUnwindSafe for ScriptRet
impl Send for ScriptRet
impl Sync for ScriptRet
impl Unpin for ScriptRet
impl !UnwindSafe for ScriptRet
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