[][src]Trait ghost_actor::ghost_actor_trait::AsGhostActor

pub trait AsGhostActor: 'static + Send + Sync {
    pub fn __invoke(
        &self,
        invoke: RawInvokeClosure
    ) -> GhostFuture<Box<dyn Any + Send + 'static>, GhostError>

Notable traits for GhostFuture<R, E>

impl<R, E> Future for GhostFuture<R, E> where
    E: 'static + From<GhostError> + Send
type Output = Result<R, E>;
;
pub fn __box_clone(&self) -> BoxGhostActor;
pub fn __is_same_actor(&self, o: &dyn Any) -> bool;
pub fn __hash_actor(&self, hasher: &mut dyn Hasher);
pub fn __is_active(&self) -> bool;
pub fn __shutdown(&self); }

Generic GhostActor Trait. You shouldn't need to deal with this unless you are implementing an alternate ghost_actor backend.

This trait allows:

  • potential alternate ghost_actor implementations
  • usage of impl AsGhostActor in functions / generics
  • type erasure via BoxGhostActor

Required methods

pub fn __invoke(
    &self,
    invoke: RawInvokeClosure
) -> GhostFuture<Box<dyn Any + Send + 'static>, GhostError>

Notable traits for GhostFuture<R, E>

impl<R, E> Future for GhostFuture<R, E> where
    E: 'static + From<GhostError> + Send
type Output = Result<R, E>;
[src]

Raw type-erased invoke function. You probably want to use a higher-level function with better type safety.

pub fn __box_clone(&self) -> BoxGhostActor[src]

BoxGhostActor::clone() uses this clone internally.

pub fn __is_same_actor(&self, o: &dyn Any) -> bool[src]

impl PartialEq for BoxGhostActor uses this function internally.

pub fn __hash_actor(&self, hasher: &mut dyn Hasher)[src]

impl Hash for BoxGhostActor uses this function internally.

pub fn __is_active(&self) -> bool[src]

Returns true if the channel is still connected to the actor task.

pub fn __shutdown(&self)[src]

Close the channel to the actor task. This will result in the task being dropped once all pending invocations have been processed.

Loading content...

Implementors

impl AsGhostActor for BoxGhostActor[src]

impl<T: 'static + Send> AsGhostActor for GhostActor<T>[src]

Loading content...