Struct RemoteActions
pub struct RemoteActions { /* private fields */ }Expand description
An application’s client for the session’s action door. Clones share one client.
Implementations§
§impl RemoteActions
impl RemoteActions
pub fn session() -> RemoteActions
pub fn session() -> RemoteActions
A client that talks through the application’s collaboration connection. Until the root hands it to the host (see the module docs), its requests wait.
pub fn with_host(
host: Arc<dyn ActionHost + Send + Sync>,
caller: Caller,
) -> RemoteActions
pub fn with_host( host: Arc<dyn ActionHost + Send + Sync>, caller: Caller, ) -> RemoteActions
A client served by host in this process, as caller.
pub fn current() -> RemoteActions
pub fn current() -> RemoteActions
The client this thread’s app should use: one served by the host a
RemoteActions::enter guard installed, else session.
pub fn enter(
host: Arc<dyn ActionHost + Send + Sync>,
caller: Caller,
) -> RemoteActionsGuard
pub fn enter( host: Arc<dyn ActionHost + Send + Sync>, caller: Caller, ) -> RemoteActionsGuard
Serve every client current makes on this thread
from host, as caller, until the guard drops — how a test or an
embedding host stands in for the session.
pub fn catalogue(
&self,
query: CatalogueQuery,
) -> LocalState<RemoteCall<CataloguePage>>
pub fn catalogue( &self, query: CatalogueQuery, ) -> LocalState<RemoteCall<CataloguePage>>
Read every page of query from the catalogue the app is offered.
pub fn catalogue_page(
&self,
query: CatalogueQuery,
) -> LocalState<RemoteCall<CataloguePage>>
pub fn catalogue_page( &self, query: CatalogueQuery, ) -> LocalState<RemoteCall<CataloguePage>>
Read exactly one bounded page of query.
This is for clients that traverse a resource hierarchy and therefore must own one global page/work budget across parents. The returned cursor is opaque and may only be sent back with the same provider, parent and revision.
pub fn invoke(
&self,
target: RemoteActionTarget,
argument: InvokeArgument,
confirmation: Option<Confirmation>,
) -> LocalState<RemoteCall<InvocationUpdate>>
pub fn invoke( &self, target: RemoteActionTarget, argument: InvokeArgument, confirmation: Option<Confirmation>, ) -> LocalState<RemoteCall<InvocationUpdate>>
Invoke the action at target with argument, carrying the person’s
explicit confirmation when its contract asks for one.
pub fn invoke_with_id(
&self,
invocation: InvocationId,
target: RemoteActionTarget,
argument: InvokeArgument,
confirmation: Option<Confirmation>,
) -> LocalState<RemoteCall<InvocationUpdate>>
pub fn invoke_with_id( &self, invocation: InvocationId, target: RemoteActionTarget, argument: InvokeArgument, confirmation: Option<Confirmation>, ) -> LocalState<RemoteCall<InvocationUpdate>>
Invoke an action with a caller-owned stable identity.
Use this when the durable object that caused the request already has a UUID. Reusing that UUID across reconnects lets the host deduplicate a retry after an acknowledgement is lost; it does not grant any authority.
pub fn cancel(
&self,
invocation: InvocationId,
) -> Option<LocalState<CancellationCall>>
pub fn cancel( &self, invocation: InvocationId, ) -> Option<LocalState<CancellationCall>>
Ask the host to cancel an invocation this client is still observing.
Repeated calls share one request and receipt. Acknowledged means only
that the host accepted the cancellation request; the invocation’s own
call is the authority for whether it actually stopped.
Trait Implementations§
§impl Clone for RemoteActions
impl Clone for RemoteActions
§fn clone(&self) -> RemoteActions
fn clone(&self) -> RemoteActions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Collaborative for RemoteActions
impl Collaborative for RemoteActions
§fn take_collab_requests(&mut self) -> Vec<CollabRequest>
fn take_collab_requests(&mut self) -> Vec<CollabRequest>
§fn handle_collab_event(&mut self, event: &CollabEvent)
fn handle_collab_event(&mut self, event: &CollabEvent)
§impl Debug for RemoteActions
impl Debug for RemoteActions
§impl Default for RemoteActions
impl Default for RemoteActions
§fn default() -> RemoteActions
fn default() -> RemoteActions
Auto Trait Implementations§
impl Freeze for RemoteActions
impl RefUnwindSafe for RemoteActions
impl Send for RemoteActions
impl Sync for RemoteActions
impl Unpin for RemoteActions
impl UnsafeUnpin for RemoteActions
impl UnwindSafe for RemoteActions
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> DowncastSync for T
impl<T> DowncastSync for T
§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