pub enum ContentLoadState {
Started,
HeadParsed,
Complete,
}Expand description
Life-cycle state of content loading in a viewer.
Models the three progress checkpoints every mainstream content
engine exposes, mapped onto the WHATWG Document.readyState
vocabulary where applicable:
Started— fetch has kicked off; no content yet. Not areadyStatevalue itself but the pre-“loading” transition every engine surfaces.HeadParsed— corresponds todocument.readyState == "interactive": the document element is available in the DOM, subresources may still be loading.Complete— corresponds todocument.readyState == "complete": document and all subresources have finished loading.
Conversion from provider types:
servo::LoadStatus— 1:1 on the three variants. Seeshell/desktop/lifecycle/webview_status_sync.rs::content_load_state_from_servo.iced_webview— thePageLoadStatus/ equivalent surface maps onto these three checkpoints; converter lives alongside the iced host adapter when iced lands as a production host.Wry(viaWebView::is_ready) — only exposes a binary ready/not- ready signal; provider converts by mapping not-ready →Startedand ready →Complete.HeadParsedis never observed under Wry today, which is acceptable — the state is advisory.- MiddleNet Direct Lane (Gemini/Gopher/Markdown viewers) — emits
Completesynchronously on first frame;Startedonly during the fetch window.
Defaulting to Self::Complete matches the pre-wrap behavior of
the toolbar view-model and avoids spurious “loading” chrome during
cold startup before any viewer has reported status.
Variants§
Started
Load request has been issued; no content bytes parsed yet.
HeadParsed
The document’s <head> has been parsed. Subresources may still
be loading. Equivalent to document.readyState == "interactive".
Complete
Document and subresources complete. Equivalent to
document.readyState == "complete".
Implementations§
Source§impl ContentLoadState
impl ContentLoadState
Sourcepub fn is_interactive(self) -> bool
pub fn is_interactive(self) -> bool
true when the viewer has loaded enough content that interaction
(scrolling, clicking links) is meaningful. Used by toolbar chrome
to gate “loading” affordances.
Sourcepub fn is_complete(self) -> bool
pub fn is_complete(self) -> bool
true when the viewer has fully completed loading. Used to
gate one-shot post-load side effects (thumbnail capture, title
refresh, link-preview prefetch).
Sourcepub fn persisted_name(self) -> &'static str
pub fn persisted_name(self) -> &'static str
Serialize to a stable machine-readable name. Prefer this over
{:?} / Debug when round-tripping through persistence or
diagnostic channels, so renaming the Rust variant doesn’t break
on-disk or on-wire data.
Sourcepub fn from_persisted_name(raw: &str) -> Option<Self>
pub fn from_persisted_name(raw: &str) -> Option<Self>
Inverse of persisted_name. Returns None for unknown names so
the caller can decide whether to fall back to Default or
surface a diagnostic.
Trait Implementations§
Source§impl Clone for ContentLoadState
impl Clone for ContentLoadState
impl Copy for ContentLoadState
Source§impl Debug for ContentLoadState
impl Debug for ContentLoadState
Source§impl Default for ContentLoadState
impl Default for ContentLoadState
Source§impl<'de> Deserialize<'de> for ContentLoadState
impl<'de> Deserialize<'de> for ContentLoadState
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>,
impl Eq for ContentLoadState
Source§impl Hash for ContentLoadState
impl Hash for ContentLoadState
Source§impl PartialEq for ContentLoadState
impl PartialEq for ContentLoadState
Source§impl Serialize for ContentLoadState
impl Serialize for ContentLoadState
impl StructuralPartialEq for ContentLoadState
Auto Trait Implementations§
impl Freeze for ContentLoadState
impl RefUnwindSafe for ContentLoadState
impl Send for ContentLoadState
impl Sync for ContentLoadState
impl Unpin for ContentLoadState
impl UnsafeUnpin for ContentLoadState
impl UnwindSafe for ContentLoadState
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> EntryIdentityKey for T
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T> MemoryPayload for T
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.