[−][src]Struct kompact::prelude::WithSender
A generic type for request-response messages
This type contains information about the target actor for the response, as well as the actual request itself.
Implementations can also be dereferenced to the request message and replied to with a response.
Implementations
impl<Req: MessageBounds, Resp: MessageBounds> WithSender<Req, Resp>
[src]
pub fn new(content: Req, sender: ActorRef<Resp>) -> WithSender<Req, Resp>
[src]
Create a new instance from a request and an actor to reply to
pub fn from(
content: Req,
sender: &dyn ActorRefFactory<Message = Resp>
) -> WithSender<Req, Resp>
[src]
content: Req,
sender: &dyn ActorRefFactory<Message = Resp>
) -> WithSender<Req, Resp>
Create a new instance from a request and something that can produce a reference to an actor to reply to
This variant is convenient from within a component, as components and their contexts implement ActorRefFactory for their actor message type.
pub fn sender(&self) -> &ActorRef<Resp>
[src]
Returns a reference to the response target actor
pub fn content(&self) -> &Req
[src]
Returns a reference to the content
pub fn take_content(self) -> Req
[src]
Takes only the content
This prevents the request from being completed,
as the sender
is dropped!
Use only after replying to the request.
Trait Implementations
impl<Req: Debug + MessageBounds, Resp: Debug + MessageBounds> Debug for WithSender<Req, Resp>
[src]
impl<Req: MessageBounds, Resp: MessageBounds> Deref for WithSender<Req, Resp>
[src]
impl<Req: MessageBounds, Resp: MessageBounds> Request for WithSender<Req, Resp>
[src]
Auto Trait Implementations
impl<Req, Resp> !RefUnwindSafe for WithSender<Req, Resp>
impl<Req, Resp> Send for WithSender<Req, Resp>
impl<Req, Resp> Sync for WithSender<Req, Resp> where
Req: Sync,
Req: Sync,
impl<Req, Resp> Unpin for WithSender<Req, Resp> where
Req: Unpin,
Req: Unpin,
impl<Req, Resp> !UnwindSafe for WithSender<Req, Resp>
Blanket Implementations
impl<T, A, P> Access<T> for P where
A: Access<T>,
P: Deref<Target = A>,
[src]
A: Access<T>,
P: Deref<Target = A>,
type Guard = <A as Access<T>>::Guard
A guard object containing the value and keeping it alive. Read more
pub fn load(&self) -> <P as Access<T>>::Guard
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, A> DynAccess<T> for A where
A: Access<T>,
<A as Access<T>>::Guard: 'static,
[src]
A: Access<T>,
<A as Access<T>>::Guard: 'static,
impl<T> Erased for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,