Skip to main content

ActorPath

Enum ActorPath 

Source
#[repr(u8)]
pub enum ActorPath { Unique(UniquePath), Named(NamedPath), }
Expand description

An actor path is a serialisable, possibly remote reference to an actor

Any message sent via an actor path might go over the network, and must be treated as fallible. It must also be serialisable.

Variants§

§

Unique(UniquePath)

A unique actor path identifies a concrete instance of an actor

Unique actor paths use the component’s unique id internally.

Unique actor paths become invalid when a component is replaced with a new instance of the same type.

A unique path may look something like "tcp://127.0.0.1:8080#1e555f40-de1d-4aee-8202-64fdc27edfa8", for example.

§

Named(NamedPath)

A named actor path identifies a service, rather than a concrete actor instance

Named paths must be registered to a particular actor, and their registration can be changed over time, as actors fail and are replaced, for example.

Named paths may be described hierarchically, similar to URLs.

A named path may look something like "tcp://127.0.0.1:8080/my-actor-group/my-actor", for example.

Implementations§

Source§

impl ActorPath

Source

pub fn set_protocol(&mut self, proto: Transport)

Change the transport protocol for this actor path

Source

pub fn via_udp(&mut self)

Sets the transport protocol for this actor path to UDP

Source

pub fn via_tcp(&mut self)

Sets the transport protocol for this actor path to TCP

Source

pub fn via_local(&mut self)

Sets the transport protocol for this actor path to LOCAL

Source

pub fn named(self) -> Option<NamedPath>

If this path is a named path, return the underlying named path

Otherwise return None.

Source

pub fn unwrap_named(self) -> NamedPath

Return the underlying named path

Panics if this is not actually a named path variant.

Source

pub fn unique(self) -> Option<UniquePath>

If this path is a unique path, return the underlying unique path

Otherwise return None.

Source

pub fn unwrap_unique(self) -> UniquePath

Return the underlying unique path

Panics if this is not actually a uniqe path variant.

Source§

impl ActorPath

Source

pub fn tell<S, B>(&self, m: B, from: &S)

Send message m to the actor designated by this path.

The from field is used as a source, and the ActorPath it resolved to will be supplied at the destination.

Source

pub fn tell_with_sender<B, D>(&self, m: B, dispatch: &D, from: ActorPath)
where B: Into<Box<dyn Serialisable>>, D: Dispatching,

Send message m to the actor designated by this path with an explicit sender.

Source

pub fn tell_serialised<CD, B>(&self, m: B, from: &CD) -> Result<(), SerError>

Send message m to the actor designated by this path with eager serialisation.

Source

pub fn tell_serialised_with_sender<CD, B>( &self, m: B, dispatch: &CD, from: ActorPath, ) -> Result<(), SerError>

Send message m to the actor designated by this path with eager serialisation and an explicit sender.

Source

pub fn tell_preserialised<CD>( &self, content: ChunkRef, from: &CD, ) -> Result<(), SerError>

Send prepared message content to the actor designated by this path.

Source

pub fn tell_preserialised_with_sender<CD>( &self, content: ChunkRef, dispatch: &CD, from: ActorPath, ) -> Result<(), SerError>

Send preserialised message content to the actor designated by this path with an explicit sender.

Source

pub fn forward_with_original_sender<D>( &self, serialised_message: NetMessage, dispatcher: &D, )
where D: Dispatching,

Forwards the still serialised message to this path without changing the sender.

Source

pub fn forward_with_sender<D>( &self, serialised_message: NetMessage, dispatch: &D, from: ActorPath, )
where D: Dispatching,

Forwards the still serialised message to this path replacing the sender with the given one.

Source

pub fn using_dispatcher<'a, 'b>( &'a self, disp: &'b dyn Dispatching, ) -> DispatchingPath<'a, 'b>

Returns a temporary combination of an ActorPath and something that can dispatch stuff.

Trait Implementations§

Source§

impl Clone for ActorPath

Source§

fn clone(&self) -> ActorPath

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ActorPath

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Deserialiser<ActorPath> for ActorPath

Source§

const SER_ID: u64 = serialisation_ids::ACTOR_PATH

The serialisation id for which this deserialiser is to be invoked
Source§

fn deserialise(buf: &mut dyn Buf) -> Result<ActorPath, SerError>

Try to deserialise a T from the given buf Read more
Source§

impl Display for ActorPath

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl From<(SystemPath, Uuid)> for ActorPath

Source§

fn from(t: (SystemPath, Uuid)) -> ActorPath

Converts to this type from the input type.
Source§

impl From<ActorPath> for PathResolvable

Source§

fn from(path: ActorPath) -> PathResolvable

Converts to this type from the input type.
Source§

impl From<NamedPath> for ActorPath

Source§

fn from(p: NamedPath) -> ActorPath

Converts to this type from the input type.
Source§

impl From<UniquePath> for ActorPath

Source§

fn from(p: UniquePath) -> ActorPath

Converts to this type from the input type.
Source§

impl FromStr for ActorPath

Source§

type Err = PathParseError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<ActorPath, <ActorPath as FromStr>::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for ActorPath

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for ActorPath

Source§

fn cmp(&self, other: &ActorPath) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for ActorPath

Source§

fn eq(&self, other: &ActorPath) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for ActorPath

Source§

fn partial_cmp(&self, other: &ActorPath) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialisable for ActorPath

Source§

fn serialise(&self, buf: &mut dyn BufMut) -> Result<(), SerError>

Serializes a Unique or Named actor path.

Source§

fn ser_id(&self) -> u64

The serialisation id for this serialisable Read more
Source§

fn size_hint(&self) -> Option<usize>

An indicator how many bytes must be reserved in a buffer for a value to be serialsed into it with this serialiser Read more
Source§

fn local( self: Box<ActorPath>, ) -> Result<Box<dyn Any + Send>, Box<dyn Serialisable>>

Try move this object onto the heap for reflection, instead of serialising Read more
Source§

fn serialised(&self) -> Result<Serialised, SerError>

Serialise with a one-off buffer Read more
Source§

fn cloned(&self) -> Option<Box<dyn Serialisable>>

Try to produce a cheap in-memory copy of this Read more
Source§

impl SystemField for ActorPath

Source§

fn system(&self) -> &SystemPath

Returns a reference to the system path
Source§

fn protocol(&self) -> Transport

Returns the transport protocol used in the system path
Source§

fn address(&self) -> &IpAddr

Returns the address used in the system path
Source§

fn port(&self) -> u16

Returns the port used in the system path
Source§

impl TryFrom<String> for ActorPath

Source§

type Error = PathParseError

The type returned in the event of a conversion error.
Source§

fn try_from( s: String, ) -> Result<ActorPath, <ActorPath as TryFrom<String>>::Error>

Performs the conversion.
Source§

impl Eq for ActorPath

Source§

impl StructuralPartialEq for ActorPath

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<T> DispatchEvent for T
where T: Any + Send + Debug,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any + Send>

Convert this event into an erased Any payload for downcasting.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> TryClone for T
where T: Clone,

Source§

fn try_clone(&self) -> Result<T, SerError>

Tries to produce a copy of self or returns an error
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Erased for T

Source§

impl<M> MessageBounds for M
where M: Debug + Send + 'static,

Source§

impl<T> SendSyncUnwindSafe for T
where T: Send + Sync + UnwindSafe + ?Sized,