Feat: Make AttributeValue::Any usable (#565)

* Implemented Display for AttributeValue::Any

* Make ArbitraryAttributeValue public

* allow(missing_docs) for ArbitraryAttributeValue

* Formatted lib.rs
This commit is contained in:
Marc Espín 2022-09-30 19:48:25 +02:00 committed by GitHub
parent 28fba42e7e
commit 964a942243
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View file

@ -66,12 +66,13 @@ impl<'a> std::fmt::Display for AttributeValue<'a> {
AttributeValue::Vec4Int(_, _, _, _) => todo!(),
AttributeValue::Vec4Uint(_, _, _, _) => todo!(),
AttributeValue::Bytes(a) => write!(f, "{:?}", a),
AttributeValue::Any(_) => todo!(),
AttributeValue::Any(a) => write!(f, "{:?}", a),
}
}
}
#[derive(Clone, Copy)]
#[allow(missing_docs)]
pub struct ArbitraryAttributeValue<'a> {
pub value: &'a dyn std::any::Any,
pub cmp: fn(&'a dyn std::any::Any, &'a dyn std::any::Any) -> bool,

View file

@ -63,10 +63,11 @@ pub(crate) mod innerlude {
}
pub use crate::innerlude::{
AnyEvent, Attribute, AttributeValue, Component, DioxusElement, DomEdit, Element, ElementId,
ElementIdIterator, EventHandler, EventPriority, IntoVNode, LazyNodes, Listener, Mutations,
NodeFactory, Properties, SchedulerMsg, Scope, ScopeId, ScopeState, TaskId, UiEvent, UserEvent,
VComponent, VElement, VFragment, VNode, VPlaceholder, VText, VirtualDom,
AnyEvent, ArbitraryAttributeValue, Attribute, AttributeValue, Component, DioxusElement,
DomEdit, Element, ElementId, ElementIdIterator, EventHandler, EventPriority, IntoVNode,
LazyNodes, Listener, Mutations, NodeFactory, Properties, SchedulerMsg, Scope, ScopeId,
ScopeState, TaskId, UiEvent, UserEvent, VComponent, VElement, VFragment, VNode, VPlaceholder,
VText, VirtualDom,
};
/// The purpose of this module is to alleviate imports of many common types