pub struct CommandScope<'a> { /* private fields */ }Expand description
命令处理器的窄上下文:暴露 shell/树/生命周期/参数,不暴露 wgpu/winit。
Implementations§
Source§impl<'a> CommandScope<'a>
impl<'a> CommandScope<'a>
Sourcepub fn new(
shell: &'a dyn WindowShell,
tree: &'a mut ElementTree,
lifecycle: Option<&'a FeatureLifecycle>,
args: &'a [String],
source: CommandSource,
needs_redraw: Option<&'a mut bool>,
needs_rebuild: Option<&'a mut bool>,
) -> Self
pub fn new( shell: &'a dyn WindowShell, tree: &'a mut ElementTree, lifecycle: Option<&'a FeatureLifecycle>, args: &'a [String], source: CommandSource, needs_redraw: Option<&'a mut bool>, needs_rebuild: Option<&'a mut bool>, ) -> Self
构造命令上下文。needs_redraw / needs_rebuild 可为 None:
自定义 RunnerApp 没有这两个标志时,按 CommandOutcome 自行调用 ctx.request_redraw()。
pub fn shell(&self) -> &dyn WindowShell
pub fn tree_mut(&mut self) -> &mut ElementTree
pub fn lifecycle(&self) -> Option<&FeatureLifecycle>
pub fn source(&self) -> CommandSource
pub fn request_redraw(&mut self)
pub fn request_rebuild(&mut self)
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for CommandScope<'a>
impl<'a> !Send for CommandScope<'a>
impl<'a> !Sync for CommandScope<'a>
impl<'a> !UnwindSafe for CommandScope<'a>
impl<'a> Forget for CommandScope<'a>
impl<'a> Freeze for CommandScope<'a>
impl<'a> Move for CommandScope<'a>
impl<'a> Unpin for CommandScope<'a>
impl<'a> UnsafeUnpin for CommandScope<'a>
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