pub enum ViewerInstanceId {
Servo(String),
// some variants omitted
}Expand description
Provider-opaque identity for a content-viewer instance.
Graphshell’s shell state tracks “which viewer has pending X?” across
multiple content engines — Servo, Wry, iced_webview, MiddleNet’s
Direct Lane — that are expected to coexist in one shell. The enum
keeps the provider explicit so mixed-provider scenarios (some panes
backed by Servo, some by Wry, some by MiddleNet) work without a
generic type parameter propagating through
GraphshellRuntime, the authority bundles, or the view-model.
Each variant’s payload is provider-chosen; each provider’s boundary
code (typically in shell/desktop/lifecycle/webview_status_sync.rs
for Servo, analogous modules for other providers) converts to/from
its native identity. The payload is session-local — not stable
across app restarts — matching the lifecycle of every underlying
native viewer id.
Current encoding choices:
Servo: JSON-encodedservo::WebViewId.WebViewId’s fields are private to the servo crate, so the portable encoding goes throughserde_jsonfor a stable, deterministic round-trip. The per-op cost is a small allocation — acceptable for the low- frequency mutation sites (thumbnail in-flight, focus target, pending context-surface requests). If it becomes a hotspot, a host-side registry mappingWebViewId↔u64is a drop-in replacement that preserves this public API.Wry,IcedWebview,MiddlenetDirect: placeholder variants representing the shape providers will fill in when they land. Kept explicit in the enum today so match arms that handle “all viewer providers” fail closed when a new one arrives.
Variants§
Servo(String)
A servo::WebViewId encoded as its serde_json representation.
The inner string is treated as opaque by the shell-state crate;
only the servo boundary inspects it.
Implementations§
Source§impl ViewerInstanceId
impl ViewerInstanceId
Sourcepub fn provider_name(&self) -> &'static str
pub fn provider_name(&self) -> &'static str
Name of the content provider that produced this id. Useful for diagnostics and for host code that needs to route dispatch per provider.
Trait Implementations§
Source§impl Clone for ViewerInstanceId
impl Clone for ViewerInstanceId
Source§fn clone(&self) -> ViewerInstanceId
fn clone(&self) -> ViewerInstanceId
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ViewerInstanceId
impl Debug for ViewerInstanceId
Source§impl<'de> Deserialize<'de> for ViewerInstanceId
impl<'de> Deserialize<'de> for ViewerInstanceId
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 ViewerInstanceId
Source§impl Hash for ViewerInstanceId
impl Hash for ViewerInstanceId
Source§impl PartialEq for ViewerInstanceId
impl PartialEq for ViewerInstanceId
Source§impl Serialize for ViewerInstanceId
impl Serialize for ViewerInstanceId
impl StructuralPartialEq for ViewerInstanceId
Auto Trait Implementations§
impl Freeze for ViewerInstanceId
impl RefUnwindSafe for ViewerInstanceId
impl Send for ViewerInstanceId
impl Sync for ViewerInstanceId
impl Unpin for ViewerInstanceId
impl UnsafeUnpin for ViewerInstanceId
impl UnwindSafe for ViewerInstanceId
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.