Skip to main content

ScryForward

Struct ScryForward 

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

The receiving side of a forward flip into a scry tile. Holds the carried view-state and drives the cookies → navigate → restore choreography across host frames.

Implementations§

Source§

impl ScryForward

Source

pub const RECEIVES: LayerSet

The layers scry can apply: SESSION (cookies), NAV (scroll; the URL is the navigation key), and FORM (refill). Not DOM (it re-fetches) nor VISUAL.

Source

pub fn new(state: PortableViewState) -> Self

Build a receiver from the carried state. The carrier has already masked it to the intersection of the donor’s offer and RECEIVES, so this keeps whatever survived.

Source

pub fn has_target(&self) -> bool

Whether there is a URL to navigate to. A flip with no URL cannot use the faithful re-fetch path; the host should fall back to the DOM-snapshot degrade path (or skip the flip) rather than drive this receiver.

Source

pub fn begin(&mut self, surface: &mut dyn ScrySurface) -> Result<(), String>

Phase 1: set the carried cookies on the WebView store, then navigate. Cookies go on before navigation so the page loads authenticated. A no-op once begun. Cookie failures are non-fatal (logged by the host); a missing cookie degrades the session, it does not block the flip.

Source

pub fn on_nav(&mut self, signal: NavSignal, surface: &mut dyn ScrySurface)

Phase 2: feed a nav signal. On the first successful Completed, run the scroll + form restore by script and finish. A failed load also finishes (there is nothing to restore onto a failed page). Ignored unless navigating.

Source

pub fn is_done(&self) -> bool

Whether the flip has run to completion (restored, failed, or had no URL).

Trait Implementations§

Source§

impl FlipReceiver for ScryForward

scry receives a Carry::Forward by storing it for the host-driven pump. A Carry::Back is meaningless for a secondary (it never re-roots), so it is ignored. present only stages the flip; begin / on_nav do the work across frames.

Source§

fn receives(&self) -> LayerSet

The layers this receiver can apply.
Source§

fn present(&mut self, carry: Carry)

Present the carried state.

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