pub struct WindowCommandRegistry { /* private fields */ }Implementations§
Source§impl WindowCommandRegistry
impl WindowCommandRegistry
pub fn new() -> Self
Sourcepub fn register_open(
&mut self,
id: impl Into<String>,
) -> Result<(), WindowCommandError>
pub fn register_open( &mut self, id: impl Into<String>, ) -> Result<(), WindowCommandError>
Sourcepub fn register_open_with_policy(
&mut self,
id: impl Into<String>,
policy: WindowCommandPolicy,
) -> Result<(), WindowCommandError>
pub fn register_open_with_policy( &mut self, id: impl Into<String>, policy: WindowCommandPolicy, ) -> Result<(), WindowCommandError>
Register an existing host window with an explicit script command policy.
§Errors
Returns duplicate, limit, or invalid-ID errors.
Sourcepub fn register_open_for_view(
&mut self,
id: impl Into<String>,
policy: WindowCommandPolicy,
view_id: impl Into<String>,
) -> Result<(), WindowCommandError>
pub fn register_open_for_view( &mut self, id: impl Into<String>, policy: WindowCommandPolicy, view_id: impl Into<String>, ) -> Result<(), WindowCommandError>
Register an existing host window and its owning mounted view.
§Errors
Returns duplicate, limit, or invalid-ID errors.
Sourcepub fn request_open(
&mut self,
spec: ScriptWindowSpec,
) -> Result<(), WindowCommandError>
pub fn request_open( &mut self, spec: ScriptWindowSpec, ) -> Result<(), WindowCommandError>
Validate and queue creation of another instance of the script entry.
§Errors
Returns duplicate, limit, queue, or spec validation errors. This Rust
entry explicitly uses trusted Host origin; scripts use request_open_from.
Sourcepub fn mark_open(&mut self, id: &str) -> Result<(), WindowCommandError>
pub fn mark_open(&mut self, id: &str) -> Result<(), WindowCommandError>
Mark successful native creation of a queued window.
§Errors
Returns unknown-window errors or an invalid transition.
pub fn fail_open(&mut self, id: &str)
Sourcepub fn request_focus(&mut self, id: &str) -> Result<(), WindowCommandError>
pub fn request_focus(&mut self, id: &str) -> Result<(), WindowCommandError>
Queue native focus with trusted Rust Host origin. A pending Open in the same queue is a valid target and retains the same reservation identity.
§Errors
Returns unknown-window or queue-limit errors.
Sourcepub fn request_focus_from(
&mut self,
source: &str,
id: &str,
) -> Result<(), WindowCommandError>
pub fn request_focus_from( &mut self, source: &str, id: &str, ) -> Result<(), WindowCommandError>
Queue focus after verifying that the source view owns window commands.
§Errors
Returns disabled-policy, unknown-window, or queue errors.
Sourcepub fn request_close(&mut self, id: &str) -> Result<(), WindowCommandError>
pub fn request_close(&mut self, id: &str) -> Result<(), WindowCommandError>
Queue forced close with trusted Rust Host origin.
§Errors
Returns unknown-window or queue-limit errors.
Sourcepub fn request_close_from(
&mut self,
source: &str,
id: &str,
) -> Result<(), WindowCommandError>
pub fn request_close_from( &mut self, source: &str, id: &str, ) -> Result<(), WindowCommandError>
Queue close after verifying that the source view owns window commands.
§Errors
Returns disabled-policy, unknown-window, or queue errors.
Sourcepub fn request_open_from(
&mut self,
source: &str,
spec: ScriptWindowSpec,
) -> Result<(), WindowCommandError>
pub fn request_open_from( &mut self, source: &str, spec: ScriptWindowSpec, ) -> Result<(), WindowCommandError>
Queue open after verifying that the source view owns window commands.
§Errors
Returns disabled-policy, validation, duplicate, limit, or queue errors.
Sourcepub fn set_close_handler(
&mut self,
id: &str,
handler: Option<ScriptCallback>,
) -> Result<(), WindowCommandError>
pub fn set_close_handler( &mut self, id: &str, handler: Option<ScriptCallback>, ) -> Result<(), WindowCommandError>
Install or clear the current generation’s close-request callback.
§Errors
Returns WindowCommandError::Unknown for an absent window.
pub fn close_handler(&self, id: &str) -> Option<ScriptCallback>
pub fn drain_commands(&mut self) -> Vec<QueuedWindowCommand>
pub fn contains(&self, id: &str) -> bool
pub fn open_ids(&self) -> Vec<String>
pub fn remove(&mut self, id: &str) -> bool
Trait Implementations§
Source§impl Clone for WindowCommandRegistry
impl Clone for WindowCommandRegistry
Source§impl Debug for WindowCommandRegistry
impl Debug for WindowCommandRegistry
Auto Trait Implementations§
impl !RefUnwindSafe for WindowCommandRegistry
impl !Send for WindowCommandRegistry
impl !Sync for WindowCommandRegistry
impl !UnwindSafe for WindowCommandRegistry
impl Freeze for WindowCommandRegistry
impl Unpin for WindowCommandRegistry
impl UnsafeUnpin for WindowCommandRegistry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<T> Variant for T
impl<T> Variant for T
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Variant trait object to &mut dyn Any.Source§fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
Variant trait object to Box<dyn Any>.