pub struct ScreenshotBuilder<'a> {
inner: Weak<ElementHandle>,
args: ScreenshotArgs<'a>,
}Fields§
§inner: Weak<ElementHandle>§args: ScreenshotArgs<'a>Implementations§
Source§impl<'a> ScreenshotBuilder<'a>
impl<'a> ScreenshotBuilder<'a>
pub(crate) fn new(inner: Weak<Impl>) -> Self
pub async fn screenshot(self) -> Result<Vec<u8>, Arc<Error>>
Sourcepub fn type(self, x: ScreenshotType) -> Self
pub fn type(self, x: ScreenshotType) -> Self
Specify screenshot type, defaults to png.
Sourcepub fn omit_background(self, x: bool) -> Self
pub fn omit_background(self, x: bool) -> Self
Hides default white background and allows capturing screenshots with transparency. Not applicable to jpeg images.
Defaults to false.
Sourcepub fn path(self, x: &'a Path) -> Self
pub fn path(self, x: &'a Path) -> Self
The file path to save the image to. The screenshot type will be inferred from file extension. If path is a relative
path, then it is resolved relative to the current working directory. If no path is provided, the image won’t be saved to
the disk.
pub fn quality(self, x: i64) -> Self
pub fn timeout(self, x: f64) -> Self
pub fn clear_omit_background(self) -> Self
pub fn clear_path(self) -> Self
pub fn clear_quality(self) -> Self
pub fn clear_timeout(self) -> Self
pub fn clear_type(self) -> Self
Auto Trait Implementations§
impl<'a> Freeze for ScreenshotBuilder<'a>
impl<'a> RefUnwindSafe for ScreenshotBuilder<'a>
impl<'a> Send for ScreenshotBuilder<'a>
impl<'a> Sync for ScreenshotBuilder<'a>
impl<'a> Unpin for ScreenshotBuilder<'a>
impl<'a> UnwindSafe for ScreenshotBuilder<'a>
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