pub struct BrowserStore {
pub cookies: BTreeMap<String, Vec<Cookie>>,
pub storage: BTreeMap<String, WebStorage>,
}Expand description
Container for all browser-style credentials. Stored as a single encrypted blob in the vault under key “browser_store”.
Fields§
Cookies indexed by domain (normalized to lowercase). Each domain has a vec of cookies.
storage: BTreeMap<String, WebStorage>Origin-scoped storage (localStorage equivalent).
Implementations§
Source§impl BrowserStore
impl BrowserStore
pub fn new() -> Self
Get all non-expired cookies that match a domain and path.
Get a specific cookie by name for a domain.
Set a cookie (replaces existing cookie with same name/domain/path).
Remove a specific cookie.
Clear all cookies for a domain.
Sourcepub fn purge_expired(&mut self)
pub fn purge_expired(&mut self)
Remove all expired cookies.
Build a Cookie header string for a request to a given URL.
List all domains that have cookies.
Sourcepub fn storage_mut(&mut self, origin: &str) -> &mut WebStorage
pub fn storage_mut(&mut self, origin: &str) -> &mut WebStorage
Get storage for an origin, creating if needed.
Sourcepub fn storage(&self, origin: &str) -> Option<&WebStorage>
pub fn storage(&self, origin: &str) -> Option<&WebStorage>
Get storage for an origin (read-only).
Sourcepub fn clear_storage(&mut self, origin: &str)
pub fn clear_storage(&mut self, origin: &str)
Clear storage for an origin.
Sourcepub fn storage_origins(&self) -> Vec<&String>
pub fn storage_origins(&self) -> Vec<&String>
List all origins that have storage.
Trait Implementations§
Source§impl Clone for BrowserStore
impl Clone for BrowserStore
Source§fn clone(&self) -> BrowserStore
fn clone(&self) -> BrowserStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BrowserStore
impl Debug for BrowserStore
Source§impl Default for BrowserStore
impl Default for BrowserStore
Source§fn default() -> BrowserStore
fn default() -> BrowserStore
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for BrowserStore
impl<'de> Deserialize<'de> for BrowserStore
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for BrowserStore
impl RefUnwindSafe for BrowserStore
impl Send for BrowserStore
impl Sync for BrowserStore
impl Unpin for BrowserStore
impl UnsafeUnpin for BrowserStore
impl UnwindSafe for BrowserStore
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