pub struct DeepLink {
pub url: String,
pub sequence: u64,
}Expand description
The deep-link read surface (frust-reactive’s app_links-
style process-wide source — see its module docs for the semantics): a
mobile shell delivers a platform link via frust-reactive’s
push_deep_link, and app code reads it here —
deep_links() returns a DeepLinks snapshot (DeepLinks::initial)
plus the live, trackable DeepLinks::latest signal a
Component::build reads to react to cold-start and subsequent links
uniformly. Router auto-wiring (resolving deep_links() against a
Router) is a separate opt-in, not automatic here.
use frust::{AnyView, Route, Router, any, deep_links, text};
struct AppState;
struct NavDemo;
fn build_router() -> Router<AppState> {
Router::new(vec![Route::new("/", |_params| -> AnyView<AppState> {
any(text("home"))
})])
}
impl frust::Component for NavDemo {
type State = AppState;
fn init(&self) -> AppState {
AppState
}
fn build(&self, _state: &mut AppState) -> AnyView<AppState> {
let _router = build_router();
// A late-subscribed read: `initial` sees a cold-start link (if any);
// `latest` is the live signal a rebuild tracks for warm links.
let links = deep_links();
let _ = links.initial;
let _ = links.latest;
any(text("nav demo"))
}
}push_deep_link is normally called by a mobile shell’s platform-link
handler; it is also re-exported here as the desktop dev seam
(no shell writes on desktop yet) — examples/navdemo’s
“simulate deep link” button calls it directly to demonstrate warm-link
navigation without a real platform link.
One delivered deep link: the raw platform-provided URL/location string
(e.g. myapp://profile/42), unparsed — turning it into a route is the
router layer’s job (the router/deep-link glue), not this crate’s.
Fields§
§url: String§sequence: u64Monotonic per-process delivery counter; compare sequences, not URLs, to apply each delivery exactly once — two identical URLs delivered twice are two deliveries.
Implementations§
Trait Implementations§
impl Eq for DeepLink
impl StructuralPartialEq for DeepLink
Auto Trait Implementations§
impl Freeze for DeepLink
impl RefUnwindSafe for DeepLink
impl Send for DeepLink
impl Sync for DeepLink
impl Unpin for DeepLink
impl UnsafeUnpin for DeepLink
impl UnwindSafe for DeepLink
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync 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.