pub struct PageState {
pub id: String,
pub url: String,
pub engine_handle: PageHandle,
pub last_tree: Option<Tree>,
pub last_token: Option<StateToken>,
pub force_full: bool,
pub seen_refs: HashSet<Ref>,
}Expand description
In-memory page state.
Fields§
§id: String§url: String§engine_handle: PageHandle§last_tree: Option<Tree>The last tree we emitted to the agent. None until the first
vs_view.
last_token: Option<StateToken>Token corresponding to last_tree, or to the post-mutation
state if a write just landed.
force_full: boolWhether the next vs_view must emit a fresh full tree (e.g.
after nav, viewport change, or auth_loaded).
seen_refs: HashSet<Ref>Refs ever seen on this page, for retire-tracking.
Implementations§
Source§impl PageState
impl PageState
pub fn new(id: String, url: String, engine_handle: PageHandle) -> Self
Sourcepub fn invalidate_baseline(&mut self)
pub fn invalidate_baseline(&mut self)
Mark the next view as a fresh-full re-baseline.
Sourcepub fn apply_snapshot(&mut self, new_tree: Tree) -> (StateToken, ViewForm)
pub fn apply_snapshot(&mut self, new_tree: Tree) -> (StateToken, ViewForm)
Apply a fresh snapshot from the engine. Returns the new token
and the ViewForm the agent should receive.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PageState
impl RefUnwindSafe for PageState
impl Send for PageState
impl Sync for PageState
impl Unpin for PageState
impl UnsafeUnpin for PageState
impl UnwindSafe for PageState
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