lurq 0.65.1

A Rust UI toolkit with typed components, retained state, reactive signals, GPU rendering, and DevTools.
Documentation
//! Without the `markdown` feature no input is styled. These stand in for the
//! styled-span hooks of the editing paths and compile to nothing.
use std::{convert::Infallible, ops::Range};

use super::*;

#[derive(Clone, Default)]
pub(super) struct StyledState;

impl StyledState {
  pub(super) fn is_bound(&self) -> bool {
    false
  }

  pub(super) fn copy_runtime_state_from(&mut self, _old: &Self) {}
}

pub(super) enum SpansBeforeEdit {}

pub(super) type SnapshotSpans = Infallible;

pub(super) type SnapshotParagraphs = Infallible;

pub(super) type SnapshotObjects = Infallible;

pub(super) struct InsertedText<'a>(std::marker::PhantomData<&'a ()>, Infallible);

impl TextInputState {
  #[inline]
  pub(super) fn sync_external_spans(&self) {}

  #[inline]
  pub(super) fn current_spans(&self) -> Option<SnapshotSpans> {
    None
  }

  #[inline]
  pub(super) fn styled_before_edit(&self) -> Option<SpansBeforeEdit> {
    None
  }

  #[inline]
  pub(super) fn styled_after_edit(&self, _edit: Option<SpansBeforeEdit>, _range: Range<usize>, _inserted: usize) {}

  #[inline]
  pub(super) fn styled_after_insert(
    &self,
    _edit: Option<SpansBeforeEdit>,
    _range: Range<usize>,
    inserted: &InsertedText<'_>,
  ) {
    match inserted.1 {}
  }

  #[inline]
  pub(super) fn restore_spans(&self, spans: SnapshotSpans) {
    match spans {}
  }

  #[inline]
  pub(super) fn current_paragraphs(&self) -> Option<SnapshotParagraphs> {
    None
  }

  #[inline]
  pub(super) fn restore_paragraphs(&self, kinds: SnapshotParagraphs) {
    match kinds {}
  }

  #[inline]
  pub(super) fn current_objects(&self) -> Option<SnapshotObjects> {
    None
  }

  #[inline]
  pub(super) fn restore_objects(&self, objects: SnapshotObjects) {
    match objects {}
  }

  /// No input has objects without the `markdown` feature.
  #[inline]
  pub(super) fn object_ranges(&self) -> Vec<Range<usize>> {
    Vec::new()
  }

  #[inline]
  pub(super) fn object_at_point(&self, _x: f32, _y: f32) -> Option<Range<usize>> {
    None
  }

  #[inline]
  pub(super) fn begin_object_resize(&self, _x: f32, _y: f32) -> bool {
    false
  }

  #[inline]
  pub(super) fn drag_object_resize(&self, _x: f32) -> bool {
    false
  }

  #[inline]
  pub(crate) fn end_object_resize(&self) {}

  #[inline]
  pub(super) fn hover_object_handle(&self, _point: Option<(f32, f32)>) {}

  #[inline]
  pub(crate) fn object_handle_hovered(&self) -> bool {
    false
  }

  /// What copying the selection puts on the clipboard: the selected text. Nothing while the input is masked, as a
  /// password field copies nothing.
  pub(crate) fn clipboard_selection(&self) -> Option<String> {
    if self.is_masked() {
      return None;
    }
    self.selected_text()
  }

  /// No input has links without the `markdown` feature.
  pub(crate) fn click_link_at_point(&self, _x: f32, _y: f32) -> bool {
    false
  }
}