pub struct SpawnableActor {
pub name: &'static LazyLock<&'static str>,
pub gspawn: fn(&Proc, &str, Data) -> Pin<Box<dyn Future<Output = Result<ActorId, Error>> + Send>>,
pub get_type_id: fn() -> TypeId,
}
Expand description
A type-erased actor registration entry. These are constructed via
crate::remote
.
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
implemetnation, which can not yet be const
.
gspawn: fn(&Proc, &str, Data) -> Pin<Box<dyn Future<Output = Result<ActorId, Error>> + Send>>
Type-erased spawn function. This is the type’s [Actor::gspawn
].
get_type_id: fn() -> TypeId
A function to retrieve the type id of the actor itself. This is used to translate a concrete type to a global name.
Trait Implementations§
Source§impl Debug for SpawnableActor
impl Debug for SpawnableActor
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 UnwindSafe for SpawnableActor
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
Mutably borrows from an owned value. Read more
§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>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
§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>
Converts
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>
Converts
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