Struct near_async::test_loop::TestLoopBuilder
source · pub struct TestLoopBuilder<Event: Debug + Send + 'static> { /* private fields */ }Expand description
Builder that should be used to construct a TestLoop. The reason why the
builder exists is that usually the Data type can only be constructed using
the event sender provided by the test loop, so this way we can avoid a
construction dependency cycle.
Implementations§
source§impl<Event: Debug + Send + 'static> TestLoopBuilder<Event>
impl<Event: Debug + Send + 'static> TestLoopBuilder<Event>
pub fn new() -> Self
sourcepub fn sender(&self) -> DelaySender<Event>
pub fn sender(&self) -> DelaySender<Event>
Returns a sender that can be used anywhere to send events to the loop.
sourcepub fn shutting_down(&self) -> Arc<AtomicBool>
pub fn shutting_down(&self) -> Arc<AtomicBool>
Returns a flag indicating whether the TestLoop system is being shut down; this is similar to whether the Actix system is shutting down.
pub fn build<Data>(self, data: Data) -> TestLoop<Data, Event>
Auto Trait Implementations§
impl<Event> Freeze for TestLoopBuilder<Event>
impl<Event> !RefUnwindSafe for TestLoopBuilder<Event>
impl<Event> Send for TestLoopBuilder<Event>
impl<Event> Sync for TestLoopBuilder<Event>
impl<Event> Unpin for TestLoopBuilder<Event>
impl<Event> !UnwindSafe for TestLoopBuilder<Event>
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
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<A, B> IntoMultiSender<B> for Awhere
B: MultiSenderFrom<A>,
impl<A, B> IntoMultiSender<B> for Awhere
B: MultiSenderFrom<A>,
fn as_multi_sender(self: &Arc<A>) -> B
fn into_multi_sender(self) -> B
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request