pub struct Profile(/* private fields */);Expand description
A WebView2 browser profile - the on-disk identity (name, path, private mode)
shared by every WebView created with it, plus its color scheme, download
folder, and browsing-data controls. Obtain it with WebView::profile.
Implementations§
Source§impl Profile
impl Profile
Sourcepub fn is_in_private_mode(&self) -> bool
pub fn is_in_private_mode(&self) -> bool
Returns true if the profile runs in private (incognito) mode.
Sourcepub fn default_download_folder_path(&self) -> String
pub fn default_download_folder_path(&self) -> String
Returns the folder downloads are saved to by default.
Sourcepub fn set_default_download_folder_path(&self, path: &str) -> Result<()>
pub fn set_default_download_folder_path(&self, path: &str) -> Result<()>
Sets the folder downloads are saved to by default.
Sourcepub fn preferred_color_scheme(&self) -> PreferredColorScheme
pub fn preferred_color_scheme(&self) -> PreferredColorScheme
Returns the color scheme reported to pages.
Sourcepub fn set_preferred_color_scheme(
&self,
scheme: PreferredColorScheme,
) -> Result<()>
pub fn set_preferred_color_scheme( &self, scheme: PreferredColorScheme, ) -> Result<()>
Sets the color scheme reported to pages through prefers-color-scheme,
driving a site’s light/dark theme.
Auto Trait Implementations§
impl !Send for Profile
impl !Sync for Profile
impl Freeze for Profile
impl RefUnwindSafe for Profile
impl Unpin for Profile
impl UnsafeUnpin for Profile
impl UnwindSafe for Profile
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