Struct consecuit::construction::component::ComponentBuilder [−][src]
pub struct ComponentBuilder { /* fields omitted */ }
Expand description
The initial consecuit
or cc
object every component takes as first argument.
For more information on how to write components, see the docs at crate.
Implementations
Make it ready to call .hook(...)
, .comp(...)
.
You shouldn’t need this, as we have a shortbut that automatically call it when you call .hook(...)
, .comp(...)
.
pub fn hook<Arg, Out, Ret, RestStores>(
self,
hook_func: fn(_: HookBuilder, _: Arg) -> Ret,
hook_arg: Arg
) -> (ComponentConstruction<RestStores, StoreCons<Ret::StoresList, RestStores>, NoHoleNode, NoHoleNode>, Out) where
RestStores: StoresList,
Ret: HookReturn<Out>,
pub fn hook<Arg, Out, Ret, RestStores>(
self,
hook_func: fn(_: HookBuilder, _: Arg) -> Ret,
hook_arg: Arg
) -> (ComponentConstruction<RestStores, StoreCons<Ret::StoresList, RestStores>, NoHoleNode, NoHoleNode>, Out) where
RestStores: StoresList,
Ret: HookReturn<Out>,
This is a shortcut that calls cc.init().hook(...)
It is here so you don’t have to write let cc = cc.init();
at the beginning of every component.
See the docs at crate
on how to call hooks.
See ComponentConstruction
for the actual .hook(...)
.
pub fn comp<Props, Ret, RestStores>(
self,
component_func: ComponentFunc<Ret, Props>,
component_props: Props
) -> ComponentConstruction<RestStores, StoreCons<ComponentStoreInstance<Ret, Props>, RestStores>, Ret::HoleNode, NoHoleNode> where
RestStores: StoresList,
Ret: ComponentReturn,
Props: ComponentProps,
pub fn comp<Props, Ret, RestStores>(
self,
component_func: ComponentFunc<Ret, Props>,
component_props: Props
) -> ComponentConstruction<RestStores, StoreCons<ComponentStoreInstance<Ret, Props>, RestStores>, Ret::HoleNode, NoHoleNode> where
RestStores: StoresList,
Ret: ComponentReturn,
Props: ComponentProps,
This is a shortcut that calls cc.init().comp(...)
It is here so you don’t have to write let cc = cc.init();
at the beginning of every component.
See the docs at crate
on how to compose components.
See ComponentConstruction
for the actual .comp(...)
.
Auto Trait Implementations
impl !RefUnwindSafe for ComponentBuilder
impl !Send for ComponentBuilder
impl !Sync for ComponentBuilder
impl Unpin for ComponentBuilder
impl !UnwindSafe for ComponentBuilder