Skip to main content

DomBridge

Struct DomBridge 

Source
pub struct DomBridge;
Expand description

An asynchronous host bridge; errors are acknowledged by the host.

Implementations§

Source§

impl DomBridge

Source

pub async fn show_modal(self, id: &Id) -> Result<(), DomError>

Open a dialog modally after mount. Fall back to an inline open dialog.

§Errors

Returns a host error when the target or API is unavailable.

Source

pub async fn close_dialog(self, id: &Id) -> Result<(), DomError>

Close a dialog. Fall back to removing its open state in the virtual DOM.

§Errors

Returns a host error when the target or API is unavailable.

Source

pub async fn toggle_popover(self, id: &Id, open: bool) -> Result<(), DomError>

Change popover visibility. Fall back to an in-flow panel.

§Errors

Returns a host error when the target or API is unavailable.

Source

pub async fn focus(self, id: &Id) -> Result<(), DomError>

Focus a node. Prefer MountedData::set_focus when a mount handle exists.

§Errors

Returns a host error when the target or API is unavailable.

Source

pub async fn scroll_into_view( self, id: &Id, block: ScrollBlock, ) -> Result<(), DomError>

Scroll a node into view; unsupported hosts leave the viewport unchanged.

§Errors

Returns a host error when the target or API is unavailable.

Source

pub async fn scroll_edges(self, id: &Id) -> Result<(bool, bool), DomError>

Whether a scroll container is at its inline start and end, read from the host the way upstream’s carousel.ts does, RTL included.

§Errors

Returns a host error when the target or API is unavailable.

Source

pub async fn page(self, id: &Id, forward: bool) -> Result<(), DomError>

Scroll a container by most of its visible width, forwards in the reading direction or back.

§Errors

Returns a host error when the target or API is unavailable.

Source

pub async fn place_below(self, list: &Id, invoker: &Id) -> Result<(), DomError>

Place a popup list under its invoker, or above it when there is no room below, capped to the space available. Positioning needs layout, so it is the host’s.

§Errors

Returns a host error when the target or API is unavailable.

Source

pub async fn place_at(self, id: &Id, point: MenuPoint) -> Result<(), DomError>

Place a fixed popup at a viewport point, as upstream’s menu.ts does: its start edge at x (or edge), clamped inside the viewport, and moved above flip_y when it would cross the bottom.

§Errors

Returns a host error when the target or API is unavailable.

Source

pub async fn point_below(self, trigger: &Id) -> Result<MenuPoint, DomError>

The point a menu opens at under a trigger: its start edge, 4px below, flipping to 4px above.

§Errors

Returns a host error when the target or API is unavailable.

Source

pub async fn capture_pointer( self, id: &Id, pointer: i32, ) -> Result<(), DomError>

Route a pointer’s events to an element for the rest of a drag.

§Errors

Returns a host error when the target or API is unavailable.

Source

pub async fn set_indeterminate( self, id: &Id, mixed: bool, ) -> Result<(), DomError>

Show a checkbox as mixed, which only a DOM property can express. Without a host the checkbox renders unchecked.

§Errors

Returns a host error when the target or API is unavailable.

Source

pub async fn copy_text(self, text: &str) -> Result<(), DomError>

Copy text through a data channel. On failure, retain selectable source text.

§Errors

Returns Unsupported or Rejected when clipboard access is unavailable.

Source

pub async fn delay(self, ms: u32) -> Result<(), DomError>

Wait ms milliseconds on the host’s clock, for timed behaviour such as toast expiry. Hosts without a script runtime return Unsupported at once, and callers keep their untimed fallback (a toast then stays until dismissed).

§Errors

Returns Unsupported when the host cannot run timers.

Source

pub async fn reload_frame(self, id: &Id) -> Result<(), DomError>

Reload a frame in place. Re-rendering the same src would not navigate.

§Errors

Returns a host error when the target is missing or not a frame.

Source

pub async fn prefers(self, preference: MediaPreference) -> Option<bool>

Whether a user preference is on, or None on hosts without media queries, where callers keep their light, standard-contrast default.

Source

pub fn watch(self, preference: MediaPreference) -> PreferenceWatch

Follow a user preference: the current value, then each change. Hosts without media queries end the stream at once.

Source

pub async fn capabilities(self) -> Capabilities

Detect available host APIs after mounting; SSR and native return defaults.

Source§

impl DomBridge

Source

pub async fn bind_editor(self, id: &Id) -> Result<EditorSession, DomError>

Attach upstream’s editor binding (editor.ts, shipped unchanged as JavaScript) to the .fc-editor with this id.

§Errors

Unsupported where the host cannot load modules (server rendering, native), and MissingTarget when no element has the id. The editor then stays plain, editable text with an inert toolbar, which upstream calls degraded but not broken.

Trait Implementations§

Source§

impl Clone for DomBridge

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for DomBridge

Source§

impl Debug for DomBridge

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DomBridge

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for DomBridge

Source§

impl PartialEq for DomBridge

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DomBridge

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DependencyElement for T
where T: 'static + PartialEq + Clone,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> InitializeFromFunction<T> for T

Source§

fn initialize_from_function(f: fn() -> T) -> T

Create an instance of this type from an initialization function
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<Ret> SpawnIfAsync<(), Ret> for Ret

Source§

fn spawn(self) -> Ret

Spawn the value into the dioxus runtime if it is an async block
Source§

impl<T, O> SuperFrom<T> for O
where O: From<T>,

Source§

fn super_from(input: T) -> O

Convert from a type to another type.
Source§

impl<T, O, M> SuperInto<O, M> for T
where O: SuperFrom<T, M>,

Source§

fn super_into(self) -> O

Convert from a type to another type.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more