#[derive(Derivative)]
#[derivative(Clone(bound = ""), PartialEq(bound = ""))]
pub struct TextFilterFn<T>(
- #[derivative(PartialEq(compare_with = "Rc::ptr_eq"))] Rc<dyn Fn(&T, &str) -> bool>,
+ #[allow(clippy::type_complexity)]
+ #[derivative(PartialEq(compare_with = "Rc::ptr_eq"))]
+ Rc<dyn Fn(&T, &str) -> bool>,
);
impl<T> TextFilterFn<T> {
/// [LoadCallback]. You can use that to trigger atomatic reloads on
/// change.
pub struct LoadCallback<T> {
+ #[allow(clippy::type_complexity)]
callback: Rc<dyn Fn() -> Pin<Box<dyn Future<Output = Result<T, Error>>>>>,
url: Option<AttrValue>, // only used for change tracking
}
}
thread_local! {
+ #[allow(clippy::type_complexity)]
static HTTP_GET: RefCell<Rc<dyn Send + Sync + Fn(String) -> Pin<Box<dyn Future<Output = Result<Value, Error>>>> >> = {
RefCell::new(Rc::new(|url| Box::pin(http_get(url))))
};
#[derive(Derivative)]
#[derivative(Clone(bound = ""), PartialEq(bound = ""))]
pub struct SorterFn<T>(
- #[derivative(PartialEq(compare_with = "Rc::ptr_eq"))] Rc<dyn Fn(&T, &T) -> Ordering>,
+ #[allow(clippy::type_complexity)]
+ #[derivative(PartialEq(compare_with = "Rc::ptr_eq"))]
+ Rc<dyn Fn(&T, &T) -> Ordering>,
);
impl<T> SorterFn<T> {
#[derive(Derivative)]
#[derivative(Clone, PartialEq)]
pub struct SubmitCallback<T>(
+ #[allow(clippy::type_complexity)]
#[derivative(PartialEq(compare_with = "Rc::ptr_eq"))]
Rc<dyn Fn(T) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>>,
);
fn filtered_record_pos(&self, key: &Key) -> Option<usize>;
fn filtered_data_len(&self) -> usize;
+ #[allow(clippy::type_complexity)]
fn filtered_data<'a>(
&'a self,
) -> Box<dyn Iterator<Item = (usize, Box<dyn DataNode<Self::Record> + 'a>)> + 'a>;
+
+ #[allow(clippy::type_complexity)]
fn filtered_data_range<'a>(
&'a self,
range: Range<usize>,
#[derive(Derivative)]
#[derivative(Clone(bound = ""), PartialEq(bound = ""))]
pub struct PageRenderFn(
- #[derivative(PartialEq(compare_with = "Rc::ptr_eq"))] Rc<dyn Fn(&str) -> Vec<Html>>,
+ #[allow(clippy::type_complexity)]
+ #[derivative(PartialEq(compare_with = "Rc::ptr_eq"))]
+ Rc<dyn Fn(&str) -> Vec<Html>>,
);
impl PageRenderFn {
#[derive(Derivative)]
#[derivative(Clone(bound = ""), PartialEq(bound = ""))]
pub struct DataTableCellRenderer<T>(
+ #[allow(clippy::type_complexity)]
#[derivative(PartialEq(compare_with = "Rc::ptr_eq"))]
Rc<dyn Fn(&mut DataTableCellRenderArgs<T>) -> Html>,
);
#[derive(Derivative)]
#[derivative(Clone(bound = ""), PartialEq(bound = ""))]
pub struct DataTableHeaderRenderer<T: 'static>(
+ #[allow(clippy::type_complexity)]
#[derivative(PartialEq(compare_with = "Rc::ptr_eq"))]
Rc<dyn Fn(&mut DataTableHeaderRenderArgs<T>) -> Html>,
);
#[derive(Derivative)]
#[derivative(Clone(bound = ""), PartialEq(bound = ""))]
pub struct DataTableRowRenderCallback<T>(
+ #[allow(clippy::type_complexity)]
#[derivative(PartialEq(compare_with = "Rc::ptr_eq"))]
Rc<dyn Fn(&mut DataTableRowRenderArgs<T>)>,
);
/// passed record is valid, and return the value to be submitted.
///
/// Wraps `Rc` around `Fn` so it can be passed as a prop.
+#[allow(clippy::type_complexity)]
pub struct SubmitValidateFn<T>(Rc<dyn Fn(&T) -> Result<Value, Error>>);
impl<T> Clone for SubmitValidateFn<T> {
/// passed record is valid.
///
/// Wraps `Rc` around `Fn` so it can be passed as a prop.
+#[allow(clippy::type_complexity)]
pub struct ValidateFn<T>(Rc<dyn Fn(&T) -> Result<(), Error>>);
/// Create a thread_local, static validation function.
/// The callback gets called with the current value of the dropdown input, and
/// should return the filtered data.
pub struct FilteredLoadCallback<T> {
+ #[allow(clippy::type_complexity)]
callback: Rc<dyn Fn(String) -> Pin<Box<dyn Future<Output = Result<T, Error>>>>>,
}