Struct ActionEmitter
pub struct ActionEmitter<I> { /* private fields */ }Expand description
A reusable action-intent queue for controls, including custom widgets.
Widgets call emit from any interaction path. Mounted shared
controls install independent host custody; custom producers should use
new_in with their actual owner domain. The private take
path remains only as explicitly unqualified migration compatibility.
Implementations§
§impl<I> ActionEmitter<I>
impl<I> ActionEmitter<I>
pub fn new(binding: ActionBinding<I>) -> ActionEmitter<I>
pub fn new_in(
binding: ActionBinding<I>,
domain: &ControlDomain,
) -> ActionEmitter<I>
pub fn new_in( binding: ActionBinding<I>, domain: &ControlDomain, ) -> ActionEmitter<I>
Construct already registered, including for emitting inside a builder.
pub fn install_custody( &mut self, domain: &ControlDomain, attachment: CustodyAttachment, ) -> Result<(), CustodyError>
pub fn emit(&mut self, input: I) -> Result<(), ActionBindingError>
pub fn emit(&mut self, input: I) -> Result<(), ActionBindingError>
Queues the typed invocation when the action is currently available.
§Errors
Returns an error when input cannot be encoded against the action’s
declared parameter contract.
pub fn take(&mut self) -> Option<ControlInvocation>
pub fn binding(&self) -> &ActionBinding<I>
pub fn refresh_availability(&mut self, allowed: &HashSet<ActionAddress>)
pub fn refresh_availability(&mut self, allowed: &HashSet<ActionAddress>)
Refresh whether the bound action is in the host’s current, permission-filtered resource surface.
pub fn is_available(&self) -> bool
pub fn metadata(&self, control_id: impl Into<String>) -> ControlBindingMetadata
pub fn metadata(&self, control_id: impl Into<String>) -> ControlBindingMetadata
Inventory entry for a custom control using this emitter.
Auto Trait Implementations§
impl<I> Freeze for ActionEmitter<I>
impl<I> !RefUnwindSafe for ActionEmitter<I>
impl<I> !Send for ActionEmitter<I>
impl<I> !Sync for ActionEmitter<I>
impl<I> Unpin for ActionEmitter<I>
impl<I> UnsafeUnpin for ActionEmitter<I>
impl<I> !UnwindSafe for ActionEmitter<I>
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
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.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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 more