ClientActor

Struct ClientActor 

Source
pub struct ClientActor(/* private fields */);

Implementations§

Source§

impl ClientActor

Source

pub fn new(client: Client) -> Result<Self>

Source§

impl ClientActor

Source

pub async fn get_servers(&self) -> Result<Vec<(GUID, String)>>

Methods from Deref<Target = Addr<Client>>§

Source

pub fn connected(&self) -> bool

Returns whether the actor is still alive.

Source

pub fn do_send<M>(&self, msg: M)
where M: Message + Send, <M as Message>::Result: Send, A: Handler<M>, <A as Actor>::Context: ToEnvelope<A, M>,

Sends a message unconditionally, ignoring any potential errors.

The message is always queued, even if the mailbox for the receiver is full. If the mailbox is closed, the message is silently dropped.

Source

pub fn try_send<M>(&self, msg: M) -> Result<(), SendError<M>>
where M: Message + Send + 'static, <M as Message>::Result: Send, A: Handler<M>, <A as Actor>::Context: ToEnvelope<A, M>,

Tries to send a message.

This method fails if actor’s mailbox is full or closed. This method registers the current task in the receiver’s queue.

Source

pub fn send<M>(&self, msg: M) -> MsgRequest<AddressSender<A>, M>
where M: Message + Send + 'static, <M as Message>::Result: Send, A: Handler<M>, <A as Actor>::Context: ToEnvelope<A, M>,

Sends an asynchronous message and waits for a response.

The communication channel to the actor is bounded. If the returned request future gets dropped, the message is cancelled.

Source

pub fn downgrade(&self) -> WeakAddr<A>

Returns a downgraded WeakAddr.

Trait Implementations§

Source§

impl Deref for ClientActor

Source§

type Target = Addr<Client>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

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> 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.