Struct SharedDoor
pub struct SharedDoor(/* private fields */);Expand description
A hosted surface’s door, cloned between its host and its catalogue.
Implementations§
pub fn resources(&self) -> Vec<ResourceSpec>
pub fn resources(&self) -> Vec<ResourceSpec>
The resources the surface published when its host last published it, with their actions.
pub fn actions(&self) -> Vec<ActionDescriptor>
pub fn actions(&self) -> Vec<ActionDescriptor>
What the surface offered when its host last published it.
pub fn revision(&self) -> u64
pub fn revision(&self) -> u64
Changes whenever Self::actions does.
pub fn invoke(
&self,
address: ActionAddress,
arguments: Map<String, Value>,
) -> Rc<RefCell<Option<Result<ResourceOperationStart, DoorError>>>>
pub fn invoke( &self, address: ActionAddress, arguments: Map<String, Value>, ) -> Rc<RefCell<Option<Result<ResourceOperationStart, DoorError>>>>
Queue address for the host. The answer is None until the host
served it.
pub fn has_queued(&self) -> bool
pub fn has_queued(&self) -> bool
Whether anything waits for the host.
pub fn serve(&self, app: &mut dyn AppWidget) -> bool
pub fn serve(&self, app: &mut dyn AppWidget) -> bool
Host: run what was queued through app’s door, oldest first.
Returns whether anything ran.
pub fn serve_with(
&self,
run: impl FnMut(&ActionAddress, &Map<String, Value>) -> Result<ResourceOperationStart, DoorError>,
) -> bool
pub fn serve_with( &self, run: impl FnMut(&ActionAddress, &Map<String, Value>) -> Result<ResourceOperationStart, DoorError>, ) -> bool
Host: run what was queued through run, the surface’s own door,
oldest first: for a host holding the surface as something other
than an AppWidget. Returns whether anything ran.
pub fn refuse_queued(&self)
pub fn refuse_queued(&self)
Host: refuse what was queued, for a surface that is gone.
pub fn publish(&self, app: Option<&dyn AppWidget>)
pub fn publish(&self, app: Option<&dyn AppWidget>)
Host: publish what app offers now; nothing for a surface that is
gone or offers nothing to this device.
pub fn publish_resources(&self, resources: Option<Vec<ResourceSpec>>)
pub fn publish_resources(&self, resources: Option<Vec<ResourceSpec>>)
Host: publish resources, what the surface offers now; None for
a surface that is gone.
Trait Implementations§
§fn clone(&self) -> SharedDoor
fn clone(&self) -> SharedDoor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§fn default() -> SharedDoor
fn default() -> SharedDoor
Auto Trait Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§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>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn 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>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which 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)
&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)
&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>
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 more