Skip to main content

AsyncRequest

Struct AsyncRequest 

Source
pub struct AsyncRequest<'a> { /* private fields */ }
Expand description

A request that runs as a future: Request for async code.

The future can be polled by any executor, or none in particular: the sockets and timers of the call belong to the ORB’s runtime. It does not block the thread that polls it, except that a call to an object of the ORB’s own server side runs the servant on an upcall thread and waits for it without blocking. The timeout is taken when invoke is called, so a timeout of the calling thread (set_thread_call_timeout) counts as it does for Request.

Implementations§

Source§

impl<'a> AsyncRequest<'a>

Source

pub fn args<F>(self, f: F) -> AsyncRequest<'a>
where F: Fn(&mut OutStream<'_>) -> Result<(), SystemException> + Send + Sync + 'a,

Request::args; the function must be Send and Sync, as the future may move between threads.

Source

pub fn timeout(self, timeout: Option<Duration>) -> AsyncRequest<'a>

Source

pub fn invoke( self, ) -> impl Future<Output = Result<Reply, Exception>> + Send + 'a

Sends the request; the future resolves to the reply.

Source

pub fn send_oneway( self, ) -> impl Future<Output = Result<(), SystemException>> + Send + 'a

Sends the request as a oneway call; the future resolves once the message is written.

Trait Implementations§

Source§

impl Debug for AsyncRequest<'_>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for AsyncRequest<'a>

§

impl<'a> !UnwindSafe for AsyncRequest<'a>

§

impl<'a> Freeze for AsyncRequest<'a>

§

impl<'a> Send for AsyncRequest<'a>

§

impl<'a> Sync for AsyncRequest<'a>

§

impl<'a> Unpin for AsyncRequest<'a>

§

impl<'a> UnsafeUnpin for AsyncRequest<'a>

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<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.