pub struct ActorRef<T: Actor> { /* private fields */ }Expand description
A guard providing mutable access to an actor.
This guard holds an Rc reference to keep the actor alive, preventing
use-after-free if the actor is removed from the registry while the guard
exists. The guard implements Deref and DerefMut for ergonomic access.
§Safety
While this guard prevents use-after-free from registry removal, it does not
prevent aliasing. Multiple ActorRef instances can exist for the same actor
simultaneously, which is technically undefined behavior but is required by
the re-entrant callback pattern in this codebase.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ActorRef<T>
impl<T> !RefUnwindSafe for ActorRef<T>
impl<T> !Send for ActorRef<T>
impl<T> !Sync for ActorRef<T>
impl<T> Unpin for ActorRef<T>where
T: Unpin,
impl<T> UnsafeUnpin for ActorRef<T>
impl<T> !UnwindSafe for ActorRef<T>
Blanket Implementations§
§impl<R> TryRngCore for Rwhere
R: TryRng,
impl<R> TryRngCore for Rwhere
R: TryRng,
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> 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§impl<R> Rng for Rwhere
R: TryRng<Error = Infallible> + ?Sized,
impl<R> Rng for Rwhere
R: TryRng<Error = Infallible> + ?Sized,
§impl<R> RngExt for Rwhere
R: Rng + ?Sized,
impl<R> RngExt for Rwhere
R: Rng + ?Sized,
§fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
Return a random value via the
StandardUniform distribution. Read more§fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>where
Self: Sized,
StandardUniform: Distribution<T>,
fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>where
Self: Sized,
StandardUniform: Distribution<T>,
§fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Generate a random value in the given range. Read more
§fn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
Return a bool with a probability
p of being true. Read more§fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
Return a bool with a probability of
numerator/denominator of being
true. Read more§fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
Sample a new value, using the given distribution. Read more
§fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T>where
D: Distribution<T>,
Self: Sized,
fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T>where
D: Distribution<T>,
Self: Sized,
Create an iterator that generates values using the given distribution. Read more
§impl<R> TryRng for R
impl<R> TryRng for R
§type Error = <<R as Deref>::Target as TryRng>::Error
type Error = <<R as Deref>::Target as TryRng>::Error
The type returned in the event of a RNG error. Read more
§fn try_next_u32(&mut self) -> Result<u32, <R as TryRng>::Error>
fn try_next_u32(&mut self) -> Result<u32, <R as TryRng>::Error>
Return the next random
u32.§fn try_next_u64(&mut self) -> Result<u64, <R as TryRng>::Error>
fn try_next_u64(&mut self) -> Result<u64, <R as TryRng>::Error>
Return the next random
u64.§fn try_fill_bytes(&mut self, dst: &mut [u8]) -> Result<(), <R as TryRng>::Error>
fn try_fill_bytes(&mut self, dst: &mut [u8]) -> Result<(), <R as TryRng>::Error>
Fill
dst entirely with random data.