Skip to main content

CommandScope

Struct CommandScope 

Source
pub struct CommandScope<'a> { /* private fields */ }
Expand description

命令处理器的窄上下文:暴露 shell/树/生命周期/参数,不暴露 wgpu/winit。

Implementations§

Source§

impl<'a> CommandScope<'a>

Source

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()。

Source

pub fn shell(&self) -> &dyn WindowShell

Source

pub fn tree_mut(&mut self) -> &mut ElementTree

Source

pub fn lifecycle(&self) -> Option<&FeatureLifecycle>

Source

pub fn source(&self) -> CommandSource

Source

pub fn args(&self) -> &[String]

仅 SecondInstance 携带命令行参数(不含 exe 路径),其余来源为空。

Source

pub fn request_redraw(&mut self)

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>