pub struct SpawnableActor {
pub name: &'static LazyLock<&'static str>,
pub gspawn_root_bind: fn(&Proc, Uid, Data, ActorEnvironment) -> Pin<Box<dyn Future<Output = Result<ActorAddr, Error>> + Send>>,
pub gspawn_child: fn(&Proc, InstanceCell, Uid, Data, ActorEnvironment) -> Pin<Box<dyn Future<Output = Result<AnyActorHandle, Error>> + Send>>,
pub get_type_id: fn() -> TypeId,
}Expand description
A type-erased actor registration entry. These are constructed via
crate::register_spawnable.
Fields§
§name: &'static LazyLock<&'static str>A URI that globally identifies an actor. It is an error to register multiple actors with the same name.
This is a LazyLock because the names are provided through a trait
implementation, which can not yet be const.
gspawn_root_bind: fn(&Proc, Uid, Data, ActorEnvironment) -> Pin<Box<dyn Future<Output = Result<ActorAddr, Error>> + Send>>Type-erased root spawn function. This is the type’s
[RemoteSpawn::gspawn_root_bind]. The ActorEnvironment is passed to
the constructor and stored unchanged on the new instance.
gspawn_child: fn(&Proc, InstanceCell, Uid, Data, ActorEnvironment) -> Pin<Box<dyn Future<Output = Result<AnyActorHandle, Error>> + Send>>Type-erased child spawn function. This is the type’s
[RemoteSpawn::gspawn_child]. The ActorEnvironment is passed to the
constructor and stored unchanged on the new instance.
get_type_id: fn() -> TypeIdA function to retrieve the type id of the actor itself. This is used to translate a concrete type to a global name.
Trait Implementations§
impl Collect for SpawnableActor
Auto Trait Implementations§
impl Freeze for SpawnableActor
impl RefUnwindSafe for SpawnableActor
impl Send for SpawnableActor
impl Sync for SpawnableActor
impl Unpin for SpawnableActor
impl UnsafeUnpin for SpawnableActor
impl UnwindSafe for SpawnableActor
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].