pub struct SceneRegistry { /* private fields */ }Expand description
场景注册表:按名查找。
Implementations§
Source§impl SceneRegistry
impl SceneRegistry
pub fn new() -> Self
pub fn register(&mut self, scene: Box<dyn Scene>)
pub fn get(&self, name: &str) -> Option<&dyn Scene>
pub fn contains(&self, name: &str) -> bool
Sourcepub fn build(&self, name: &str) -> Result<WidgetNode, String>
pub fn build(&self, name: &str) -> Result<WidgetNode, String>
按名构建根 widget;未知场景返回带可用列表的错误,避免调用方 unwrap()。
pub fn names(&self) -> Vec<&'static str>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SceneRegistry
impl !Send for SceneRegistry
impl !Sync for SceneRegistry
impl !UnwindSafe for SceneRegistry
impl Forget for SceneRegistry
impl Freeze for SceneRegistry
impl Move for SceneRegistry
impl Unpin for SceneRegistry
impl UnsafeUnpin for SceneRegistry
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