Skip to main content

TestContext

Struct TestContext 

Source
pub struct TestContext<R> { /* private fields */ }

Trait Implementations§

Source§

impl<R> Bind<NetAddress> for TestContext<R>
where R: Send + 'static,

Source§

async fn bind( &mut self, args: BindArgs<NetAddress>, ) -> Result<(), ErrorOf<BindErrorKind>>

Source§

impl<R> Debug for TestContext<R>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<R> Fork for TestContext<R>
where R: Send + 'static,

Source§

async fn fork(&mut self) -> Result<Self, ErrorOf<ForkErrorKind>>

Source§

async fn run<F, Fut>(self, fun: F)
where F: FnOnce(Self) -> Fut + Send + 'static, Fut: Future + Send + 'static,

Source§

impl<R> InitDone for TestContext<R>
where R: Send,

Source§

async fn init_done(&mut self, address: Address)

Source§

impl<R> Linking for TestContext<R>
where R: Send,

Source§

async fn set_trap_exit(&mut self, enable: bool)

Source§

impl<R> Messaging for TestContext<R>
where R: Send,

Source§

fn address(&self) -> Address

Source§

async fn close(&mut self)

Source§

async fn recv(&mut self) -> Result<Envelope, ErrorOf<RecvErrorKind>>

Source§

async fn send( &mut self, envelope: Envelope, ) -> Result<(), ErrorOf<SendErrorKind>>

Source§

async fn forward( &mut self, to: Address, envelope: Envelope, ) -> Result<(), ErrorOf<SendErrorKind>>

Source§

impl<R> Now for TestContext<R>
where R: Send,

Source§

type Instant = Instant

Source§

fn now(&self) -> Self::Instant

Source§

impl<R> Quit for TestContext<R>
where R: Send,

Source§

async fn quit_ok(&mut self) -> Never

Source§

async fn quit_err<E>(&mut self, reason: E) -> Never
where E: Error + Send + Sync + 'static,

Source§

fn quit<E>( &mut self, result: Result<(), E>, ) -> impl Future<Output = Infallible> + Send
where E: Error + Send + Sync + 'static,

Source§

impl<R> Start<R> for TestContext<R>
where R: Send,

Source§

async fn spawn( &mut self, runnable: R, link: bool, ) -> Result<Address, ErrorOf<SpawnErrorKind>>

Source§

async fn start( &mut self, runnable: R, link: bool, start_timeout: Duration, ) -> Result<Address, ErrorOf<StartErrorKind>>

Source§

impl<R> Stop for TestContext<R>
where R: Send,

Source§

async fn exit(&mut self, peer: Address) -> bool

Source§

async fn kill(&mut self, peer: Address) -> bool

Source§

fn shutdown( &mut self, peer: Address, stop_timeout: Duration, ) -> impl Future<Output = Result<(), ErrorOf<ShutdownErrorKind>>> + Send
where Self: Watching + Fork + Messaging,

Source§

impl<R> Watching for TestContext<R>
where R: Send,

Source§

async fn watch(&mut self, peer: Address) -> WatchRef

Source§

async fn unwatch(&mut self, watch_ref: WatchRef)

Auto Trait Implementations§

§

impl<R> Freeze for TestContext<R>

§

impl<R> !RefUnwindSafe for TestContext<R>

§

impl<R> Send for TestContext<R>
where R: Send,

§

impl<R> Sync for TestContext<R>
where R: Send,

§

impl<R> Unpin for TestContext<R>

§

impl<R> !UnwindSafe for TestContext<R>

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Tell for T
where T: Messaging,

Source§

fn tell<M>( &mut self, to: Address, message: M, ) -> impl Future<Output = Result<(), ErrorOf<SendErrorKind>>> + Send
where M: Message,

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more