MCPcopy Create free account
hub / github.com/angular-rust/ux-components / get

Method get

src/rendering/backend/widget_render_factory.rs:74–90  ·  view source on GitHub ↗

Asks the Rendering service for a Renderer instance, For a given control struct type and instance.

(&self)

Source from the content-addressed store, hash-verified

72 /// Asks the Rendering service for a Renderer instance,
73 /// For a given control struct type and instance.
74 pub fn get<T: 'static + Debug>(&self) -> Option<Rc<WidgetRenderHolder<T>>> {
75 let type_id = TypeId::of::<T>();
76
77 match self.storages.borrow().get(&type_id) {
78 Some(item) => match item.clone().downcast::<WidgetRenderHolder<T>>() {
79 Ok(render) => Some(render),
80 Err(_) => {
81 log::error!("Something wrong with render storage");
82 None
83 }
84 },
85 None => {
86 log::warn!("Not found render for {}", std::any::type_name::<T>());
87 None
88 }
89 }
90 }
91}
92
93impl Singleton for WidgetRenderFactory {

Callers 15

initMethod · 0.45
initMethod · 0.45
initMethod · 0.45
initMethod · 0.45
initMethod · 0.45
initMethod · 0.45
initMethod · 0.45
initMethod · 0.45
initMethod · 0.45
initMethod · 0.45
initMethod · 0.45

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected