Struct oxygengine_user_interface::widget::component::WidgetComponent
source · [−]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
sourceimpl 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
sourceimpl Clone for WidgetComponent
impl Clone for WidgetComponent
sourcefn clone(&self) -> WidgetComponent
fn clone(&self) -> WidgetComponent
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for WidgetComponent
impl Debug for WidgetComponent
sourceimpl From<WidgetComponent> for WidgetNode
impl From<WidgetComponent> for WidgetNode
sourcefn from(component: WidgetComponent) -> WidgetNode
fn from(component: WidgetComponent) -> WidgetNode
Converts to this type from the input type.
sourceimpl TryFrom<WidgetNode> for WidgetComponent
impl TryFrom<WidgetNode> for WidgetComponent
sourcefn 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more