Skip to main content

CreateTargetBuilder

Struct CreateTargetBuilder 

Source
pub struct CreateTargetBuilder { /* private fields */ }
Expand description

Builder for CreateTarget.

Implementations§

Source§

impl CreateTargetBuilder

Source

pub fn url<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

The initial URL the page will be navigated to. An empty string indicates about:blank.

Source

pub fn left<VALUE: Into<JsUInt>>(&mut self, value: VALUE) -> &mut Self

Frame left origin in DIP (requires newWindow to be true or headless shell).

Source

pub fn top<VALUE: Into<JsUInt>>(&mut self, value: VALUE) -> &mut Self

Frame top origin in DIP (requires newWindow to be true or headless shell).

Source

pub fn width<VALUE: Into<JsUInt>>(&mut self, value: VALUE) -> &mut Self

Frame width in DIP (requires newWindow to be true or headless shell).

Source

pub fn height<VALUE: Into<JsUInt>>(&mut self, value: VALUE) -> &mut Self

Frame height in DIP (requires newWindow to be true or headless shell).

Source

pub fn window_state<VALUE: Into<WindowState>>( &mut self, value: VALUE, ) -> &mut Self

Frame window state (requires newWindow to be true or headless shell). Default is normal.

Source

pub fn browser_context_id<VALUE: Into<BrowserContextId>>( &mut self, value: VALUE, ) -> &mut Self

The browser context to create the page in.

Source

pub fn enable_begin_frame_control<VALUE: Into<bool>>( &mut self, value: VALUE, ) -> &mut Self

Whether BeginFrames for this target will be controlled via DevTools (headless shell only, not supported on MacOS yet, false by default).

Source

pub fn new_window<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self

Whether to create a new Window or Tab (false by default, not supported by headless shell).

Source

pub fn background<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self

Whether to create the target in background or foreground (false by default, not supported by headless shell).

Source

pub fn for_tab<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self

Whether to create the target of type “tab”.

Source

pub fn hidden<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self

Whether to create a hidden target. The hidden target is observable via protocol, but not present in the tab UI strip. Cannot be created with forTab: true, newWindow: true or background: false. The life-time of the tab is limited to the life-time of the session.

Source

pub fn focus<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self

If specified, the option is used to determine if the new target should be focused or not. By default, the focus behavior depends on the value of the background field. For example, background=false and focus=false will result in the target tab being opened but the browser window remain unchanged (if it was in the background, it will remain in the background) and background=false with focus=undefined will result in the window being focused. Using background: true and focus: true is not supported and will result in an error.

Source

pub fn build(&self) -> Result<CreateTarget, CreateTargetBuilderError>

Builds a new CreateTarget.

§Errors

If a required field has not been initialized.

Trait Implementations§

Source§

impl Clone for CreateTargetBuilder

Source§

fn clone(&self) -> CreateTargetBuilder

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Default for CreateTargetBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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<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> 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.