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: Arc<SessionHandle>, value: Value) -> ScriptRet
pub fn new(handle: Arc<SessionHandle>, value: Value) -> ScriptRet
Create a new ScriptRet.
This is typically done automatically via WebDriver::execute
or WebDriver::execute_async.
Sourcepub fn convert<T>(&self) -> Result<T, WebDriverError>where
T: DeserializeOwned,
pub fn convert<T>(&self) -> Result<T, WebDriverError>where
T: DeserializeOwned,
Convert the JSON value into the a deserializeable type.
Sourcepub fn element(self) -> Result<WebElement, WebDriverError>
pub fn element(self) -> Result<WebElement, WebDriverError>
Get a single WebElement return value.
Your script must return only a single element for this to work.
Sourcepub fn elements(self) -> Result<Vec<WebElement>, WebDriverError>
pub fn elements(self) -> Result<Vec<WebElement>, WebDriverError>
Get a vec of WebElements from the return value.
Your script must return an array of elements for this to work.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ScriptRet
impl !UnwindSafe for ScriptRet
impl Freeze for ScriptRet
impl Send for ScriptRet
impl Sync for ScriptRet
impl Unpin for ScriptRet
impl UnsafeUnpin 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