pub struct Ref<M> {
pub mailbox: Arc<Mailbox>,
pub facet_id: FacetId,
pub target: Mutex<Option<Box<dyn Entity<M>>>>,
}Expand description
A reference to an object that expects messages/assertions of type
M.
The object can be in the same actor, in a different local (in-process) actor, or accessible across a network link.
Fields§
§mailbox: Arc<Mailbox>Mailbox of the actor owning the referenced entity.
facet_id: FacetIdID of the facet (within the actor) owning the referenced entity.
target: Mutex<Option<Box<dyn Entity<M>>>>Mutex owning and guarding the state backing the referenced entity.
Implementations§
source§impl<M> Ref<M>
impl<M> Ref<M>
sourcepub fn become_entity<E: 'static + Entity<M>>(&self, e: E)
pub fn become_entity<E: 'static + Entity<M>>(&self, e: E)
Supplies the behaviour (e) for a Ref created via
create_inert.
§Panics
Panics if this Ref has already been given a behaviour.
Trait Implementations§
source§impl<M> Ord for Ref<M>
impl<M> Ord for Ref<M>
source§impl<M> PartialEq for Ref<M>
impl<M> PartialEq for Ref<M>
source§impl<M> PartialOrd for Ref<M>
impl<M> PartialOrd for Ref<M>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl<M> Eq for Ref<M>
Auto Trait Implementations§
impl<M> !RefUnwindSafe for Ref<M>
impl<M> Send for Ref<M>
impl<M> Sync for Ref<M>
impl<M> Unpin for Ref<M>
impl<M> !UnwindSafe for Ref<M>
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