Trait tea_sdk::actorx::Actor

pub trait Actor: 'static {
    // Required methods
    async fn invoke(&self, req: &[u8]) -> Result<Vec<u8>, Global>;
    async fn size(&self) -> Result<u64, Global>;

    // Provided methods
    async fn metadata(&self) -> Result<Arc<Metadata>, Global> { ... }
    fn id(&self) -> Option<ActorId> { ... }
    async fn instance_count(&self) -> Result<u8, Global> { ... }
}

Required Methods§

async fn invoke(&self, req: &[u8]) -> Result<Vec<u8>, Global>

async fn size(&self) -> Result<u64, Global>

Provided Methods§

async fn metadata(&self) -> Result<Arc<Metadata>, Global>

fn id(&self) -> Option<ActorId>

async fn instance_count(&self) -> Result<u8, Global>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl Actor for Box<dyn ActorSendDyn>

§

async fn invoke(&self, req: &[u8]) -> Result<Vec<u8>, Global>

§

async fn metadata(&self) -> Result<Arc<Metadata>, Global>

§

fn id(&self) -> Option<ActorId>

§

async fn size(&self) -> Result<u64, Global>

§

async fn instance_count(&self) -> Result<u8, Global>

Implementors§

§

impl<T> Actor for Twhere T: HandlerActor + 'static,