pub struct DataStore { /* private fields */ }Expand description
Where a page keeps its cookies, storage and cache.
The default is the platform’s own store, shared by every page built with it.
Implementations§
Source§impl DataStore
impl DataStore
pub fn new() -> Self
Sourcepub fn incognito(self) -> Self
pub fn incognito(self) -> Self
Kept in memory and gone with the page. Overrides the directory and the identifier. On Windows, needs WebView2 Runtime 101.0.1210.39 or later, and is ignored before it.
Sourcepub fn with_directory(self, directory: impl Into<PathBuf>) -> Self
pub fn with_directory(self, directory: impl Into<PathBuf>) -> Self
Windows: the directory the store lives in. Pages built with one directory share one store. Ignored on macOS.
Sourcepub fn with_identifier(self, identifier: [u8; 16]) -> Self
pub fn with_identifier(self, identifier: [u8; 16]) -> Self
macOS 14 and later: the persistent store with this identifier, a UUID’s bytes. Pages built with one identifier share one store. Ignored elsewhere, and on earlier macOS, where the page uses the default store.
Sourcepub fn clear(&self, cx: &App) -> Task<bool> ⓘ
pub fn clear(&self, cx: &App) -> Task<bool> ⓘ
Clears the cookies, storage and cache this store keeps. Every page
built with the store must be closed first. Resolves to whether it was
cleared: an
incognito store keeps nothing and resolves true. Resolves false off
macOS.
On macOS before 14 an identifier’s store is the default one.
Trait Implementations§
impl Eq for DataStore
impl StructuralPartialEq for DataStore
Auto Trait Implementations§
impl Forget for DataStore
impl Freeze for DataStore
impl Move for DataStore
impl RefUnwindSafe for DataStore
impl Send for DataStore
impl Sync for DataStore
impl Unpin for DataStore
impl UnsafeUnpin for DataStore
impl UnwindSafe for DataStore
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().