pub struct WidgetComponent {
pub processor: fn(_: WidgetContext<'_, '_>) -> WidgetNode,
pub type_name: String,
pub key: Option<String>,
pub idref: Option<WidgetRef>,
pub props: Props,
pub shared_props: Option<Props>,
pub listed_slots: Vec<WidgetNode, Global>,
pub named_slots: HashMap<String, WidgetNode, RandomState>,
}
Fields§
§processor: fn(_: WidgetContext<'_, '_>) -> WidgetNode
§type_name: String
§key: Option<String>
§idref: Option<WidgetRef>
§props: Props
§listed_slots: Vec<WidgetNode, Global>
§named_slots: HashMap<String, WidgetNode, RandomState>
Implementations§
source§impl WidgetComponent
impl WidgetComponent
pub fn new( processor: fn(_: WidgetContext<'_, '_>) -> WidgetNode, type_name: &str ) -> WidgetComponent
pub fn key<T>(self, v: T) -> WidgetComponentwhere T: ToString,
pub fn idref<T>(self, v: T) -> WidgetComponentwhere T: Into<WidgetRef>,
pub fn with_props<T>(self, v: T) -> WidgetComponentwhere T: 'static + PropsData,
pub fn merge_props(self, v: Props) -> WidgetComponent
pub fn listed_slot<T>(self, v: T) -> WidgetComponentwhere T: Into<WidgetNode>,
pub fn listed_slots<I, T>(self, v: I) -> WidgetComponentwhere I: Iterator<Item = T>, T: Into<WidgetNode>,
pub fn named_slot<T>(self, k: &str, v: T) -> WidgetComponentwhere T: Into<WidgetNode>,
pub fn named_slots<I, K, T>(self, v: I) -> WidgetComponentwhere I: Iterator<Item = (K, T)>, K: ToString, T: Into<WidgetNode>,
pub fn remap_props<F>(&mut self, f: F)where F: FnMut(Props) -> Props,
Trait Implementations§
source§impl Clone for WidgetComponent
impl Clone for WidgetComponent
source§fn clone(&self) -> WidgetComponent
fn clone(&self) -> WidgetComponent
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for WidgetComponent
impl Debug for WidgetComponent
source§impl From<WidgetComponent> for WidgetNode
impl From<WidgetComponent> for WidgetNode
source§fn from(component: WidgetComponent) -> WidgetNode
fn from(component: WidgetComponent) -> WidgetNode
Converts to this type from the input type.
source§impl TryFrom<WidgetNode> for WidgetComponent
impl TryFrom<WidgetNode> for WidgetComponent
source§fn try_from(
node: WidgetNode
) -> Result<WidgetComponent, <WidgetComponent as TryFrom<WidgetNode>>::Error>
fn try_from( node: WidgetNode ) -> Result<WidgetComponent, <WidgetComponent as TryFrom<WidgetNode>>::Error>
Performs the conversion.
Auto Trait Implementations§
impl !RefUnwindSafe for WidgetComponent
impl Send for WidgetComponent
impl Sync for WidgetComponent
impl Unpin for WidgetComponent
impl !UnwindSafe for WidgetComponent
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
Mutably borrows from an owned value. Read more