Skip to main content

TestComponent1

Struct TestComponent1 

Source
pub struct TestComponent1 { /* private fields */ }
Expand description

A test component

Implementations§

Source§

impl TestComponent1

Source

pub fn new() -> TestComponent1

Create a new test component

Trait Implementations§

Source§

impl ActorRaw for TestComponent1

Source§

type Message = !

The type of local messages the actor accepts
Source§

fn receive(&mut self, env: MsgEnvelope<Self::Message>) -> HandlerResult

Handle an incoming message Read more
Source§

impl ComponentDefinition for TestComponent1

Source§

fn setup(&mut self, self_component: Arc<Component<Self>>)

Prepare the component for being run Read more
Source§

fn execute(&mut self, max_events: usize, skip: usize) -> ExecuteResult

Execute events on the component’s ports Read more
Source§

fn ctx_mut(&mut self) -> &mut ComponentContext<Self>

Return a mutable reference the component’s context field
Source§

fn ctx(&self) -> &ComponentContext<Self>

Return a reference the component’s context field
Source§

fn type_name() -> &'static str

Return the name of the component’s type Read more
Source§

fn spawn_local<F>( &mut self, f: impl FnOnce(ComponentDefinitionAccess<Self>) -> F, )
where Self: 'static, F: Future<Output = HandlerResult> + Send + 'static,

Run a Future on this component, allowing it mutable access to the component’s internal state on every poll. Read more
Source§

fn spawn_off<R: Send + 'static>( &self, future: impl Future<Output = R> + 'static + Send, ) -> JoinHandle<R>

Run a Future on this system’s executor pool and return a handle to the result Read more
Source§

impl ComponentLifecycle for TestComponent1

Source§

fn on_start(&mut self) -> HandlerResult
where Self: 'static,

Gets invoked every time a component receives a Start event Read more
Source§

fn on_stop(&mut self) -> HandlerResult
where Self: 'static,

Gets invoked every time a component receives a Stop event Read more
Source§

fn on_kill(&mut self) -> HandlerResult
where Self: 'static,

Gets invoked every time a component receives a Kill event Read more
Source§

impl DynamicPortAccess for TestComponent1

Source§

fn get_provided_port_as_any(&mut self, port_id: TypeId) -> Option<&mut dyn Any>

Internal API. Dynamically obtain a mutable reference to a ProvidedPort if self provides a port of the type indicated by the passed port_id. Read more
Source§

fn get_required_port_as_any(&mut self, port_id: TypeId) -> Option<&mut dyn Any>

Internal API. Dynamically obtain a mutable reference to a RequiredPort if self requires a port of the type indicated by the passed port_id. Read more
Source§

impl Provide<TestPort> for TestComponent1

Source§

fn handle(&mut self, _event: Never) -> HandlerResult

Handle the port’s event Read more
Source§

impl ProvideRef<TestPort> for TestComponent1

Source§

fn provided_ref(&mut self) -> ProvidedRef<TestPort>

Returns a provided reference to this component’s port instance of type P
Source§

fn connect_to_required(&mut self, req: RequiredRef<TestPort>)

Connects this component’s provided port instance of type P to req
Source§

fn disconnect(&mut self, req: RequiredRef<TestPort>)

Disconnects this component’s provided port instance of type P from req

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<CD> ActorRefFactory for CD

Source§

type Message = <CD as ActorRaw>::Message

The type of messages carried by references produced by this factory
Source§

fn actor_ref(&self) -> ActorRef<<CD as ActorRefFactory>::Message>

Returns the associated actor reference
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<CD> ComponentLogging for CD

Source§

fn log(&self) -> &Logger<Arc<Fuse<Async>>>

Returns a reference to the component’s logger instance Read more
Source§

impl<CD> ComponentTraits for CD
where CD: ComponentDefinition + ActorRaw + 'static,

Source§

impl<T> DynamicComponentDefinition for T

Source§

impl<T> Erased for T

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

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<M, T, A> Receiver<T> for A
where T: Debug + 'static, M: From<T> + MessageBounds, A: ActorRefFactory<Message = M>,

Source§

fn recipient(&self) -> Recipient<T>

Produce a recipient for T
Source§

impl<CD> Timer<CD> for CD
where CD: ComponentTraits,

Source§

fn schedule_once<F>(&mut self, timeout: Duration, action: F) -> ScheduledTimer

Schedule the action to be run once after timeout expires Read more
Source§

fn schedule_periodic<F>( &mut self, delay: Duration, period: Duration, action: F, ) -> ScheduledTimer
where F: Fn(&mut CD, ScheduledTimer) -> Result<Handled, HandlerError> + Send + 'static,

Schedule the action to be run every timeout time units Read more
Source§

fn cancel_timer(&mut self, handle: ScheduledTimer)

Cancel the timer indicated by the handle Read more
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.
Source§

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

Source§

fn vzip(self) -> V