Struct lunatic_twitchax_patch::time::WithTimeout
source · pub struct WithTimeout<T> { /* private fields */ }Expand description
Modifies T so that all functions on it will return a timeout.
It’s used to time out calls such as ProcessRef::shutdown,
ProcessRef::request, etc.
Implementations§
source§impl<T: AbstractProcess> WithTimeout<ProcessRef<T>>
impl<T: AbstractProcess> WithTimeout<ProcessRef<T>>
pub fn from(timeout: Duration, item: ProcessRef<T>) -> Self
sourcepub fn shutdown(&self) -> Result<(), Timeout>
pub fn shutdown(&self) -> Result<(), Timeout>
Shuts the AbstractProcess down.
The function will only wait for the duration of the specified timeout on
the process to shut down, before returning Err(Timeout).
sourcepub fn request<R: 'static>(&self, request: R) -> Result<T::Response, Timeout>where
T: RequestHandler<R>,
T::Serializer: CanSerialize<R> + CanSerialize<T::Response> + CanSerialize<RequestMessage<R, T::Response, T::Serializer>>,
pub fn request<R: 'static>(&self, request: R) -> Result<T::Response, Timeout>where
T: RequestHandler<R>,
T::Serializer: CanSerialize<R> + CanSerialize<T::Response> + CanSerialize<RequestMessage<R, T::Response, T::Serializer>>,
Make a request to the process.
The function will only wait for the duration of the specified timeout on
the response, before returning Err(Timeout).
sourcepub fn deferred_request<R: 'static>(
&self,
request: R
) -> Result<T::Response, Timeout>where
T: DeferredRequestHandler<R>,
T::Serializer: CanSerialize<R> + CanSerialize<T::Response> + CanSerialize<RequestMessage<R, T::Response, T::Serializer>>,
pub fn deferred_request<R: 'static>(
&self,
request: R
) -> Result<T::Response, Timeout>where
T: DeferredRequestHandler<R>,
T::Serializer: CanSerialize<R> + CanSerialize<T::Response> + CanSerialize<RequestMessage<R, T::Response, T::Serializer>>,
Make a deferred request to the process.
The function will only wait for the duration of the specified timeout on
the response, before returning Err(Timeout).
Auto Trait Implementations§
impl<T> RefUnwindSafe for WithTimeout<T>where
T: RefUnwindSafe,
impl<T> Send for WithTimeout<T>where
T: Send,
impl<T> Sync for WithTimeout<T>where
T: Sync,
impl<T> Unpin for WithTimeout<T>where
T: Unpin,
impl<T> UnwindSafe for WithTimeout<T>where
T: UnwindSafe,
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