[][src]Module kompact::prelude

To get all kompact related things into scope import as use kompact::prelude::*.

Re-exports

pub use crate::ignore_control;
pub use crate::ignore_indications;
pub use crate::ignore_lifecycle;
pub use crate::ignore_requests;
pub use crate::info_lifecycle;
pub use crate::match_deser;
pub use crate::component::ComponentLogging;
pub use crate::component::CoreContainer;
pub use crate::component::ExecuteResult;
pub use crate::component::Handled;
pub use crate::component::LockingProvideRef;
pub use crate::component::LockingRequireRef;
pub use crate::component::Provide;
pub use crate::component::ProvideRef;
pub use crate::component::Require;
pub use crate::component::RequireRef;
pub use crate::net::buffers::BufferConfig;
pub use crate::net::buffers::ChunkLease;
pub use crate::net::buffers::ChunkRef;
pub use crate::Never;
pub use crate::default_components::CustomComponents;
pub use crate::default_components::DeadletterBox;
pub use crate::default_components::LocalDispatcher;
pub use crate::messaging::MsgEnvelope;
pub use crate::messaging::PathResolvable;
pub use crate::routing::groups::StorePolicy;

Modules

ser_helpers

Serialisation helper functions

ser_test_helpers

A module with helper functions for serialisation tests

serde_serialisers

Provides serialisation support for Serde

serialisation_ids

Contains constants with internal serialisation ids.

Macros

crit

Log critical level record

debug

Log debug level record

error

Log error level record

info

Log info level record

o

Macro for building group of key-value pairs: OwnedKV

trace

Log trace level record

warn

Log warning level record

Structs

ActorRef

A reference to an actor with type Message = M;

ActorRefStrong

A version of ActorRef that prevents the target from being deallocated

Ask

A message type for request-response messages.

Component

A concrete component instance

ComponentContext

The contextual object for a Kompact component

ComponentDefinitionAccess

Gives access to the component definition within a future/async function

DispatchingPath

A temporary combination of an ActorPath and something that can dispatch stuff

DynActorRef

A kind of actor reference that only allows network messages to be sent

FaultContext

Information about the fault that occurred

Fuse

Drain panicking on error

KFuture

A custom future implementation, that can be fulfilled via its paired promise.

KPromise

A custom promise implementation, that can be used to fulfil its paired future.

KompactConfig

A configuration builder for Kompact systems

KompactSystem

A Kompact system is a collection of components and services

Logger

Logging handle used to execute logging statements

NamedPath

A named actor path identifies a service, rather than a concrete actor instance

NetMessage

An incoming message from the networking subsystem

NetworkConfig

Configuration builder for the network dispatcher

NetworkDispatcher

A network-capable dispatcher for sending messages to remote actors

ProvidedPort

An instance of a port type P that is marked as provided

ProvidedRef

A reference to a provided port

Recipient

A version of ActorRef that automatically converts M into some M' as specified by the actor that created the Recipient from its own ActorRef.

RecoveryHandler

Instructions on how to recover from a component fault

RequiredPort

An instance of a port type P that is marked as required

RequiredRef

A reference to a required port

ScheduledTimer

Opaque reference to a scheduled instance of a timer

SerialisableValue

A data type equivalent to a pair of value and a serialiser for it

Serialised

Wrapper for serialised data with a serialisation id

SystemPath

The part of an ActorPath that refers to the KompactSystem

UniquePath

A unique actor path identifies a concrete instance of an actor

WithRecipient

A generic type for request-response messages with a Recipient as actor reference

WithSender

A generic type for request-response messages

WithSenderStrong

A generic type for request-response messages with a strong actor reference

Enums

ActorPath

An actor path is a serialisable, possibly remote reference to an actor

DispatchEnvelope

Envelope with messages for the system'sdispatcher

PathParseError

Error type for parsing paths from a string

PromiseErr

An error returned when a promise can't be fulfilled.

RegistrationError

An error that can occur during actor path registration

SerError

Errors that can be thrown during serialisation or deserialisation

Transport

Transport protocol to use for delivering messages sent to an ActorPath

TryDualLockError

This error type is returned when on on_dual_definition fails, indicating that a proper lock could not be established on both components.

UnpackError

An error that is thrown when deserialisation of a NetMessage is attempted.

Traits

Actor

A slightly higher level Actor API that handles both local and networked messages

ActorPathFactory

A factory trait for things that have associated actor paths

ActorRaw

The base trait for all actors

ActorRefFactory

A trait for things that have associated actor references

Any

A trait to emulate dynamic typing.

Buf

Read bytes from a buffer.

BufMut

A trait for values that provide sequential write access to bytes.

CanCancelTimers

API for cancelling timers

ComponentDefinition

The core trait every component must implement

ComponentLifecycle

A trait to customise handling of lifecycle events

Deserialisable

A trait for values that can get deserialised themselves

Deserialiser

A trait to deserialise values of type T from buffers

Dispatcher

A dispatcher is a system component that knows how to route messages and create system paths

Dispatching

A trait for accessing dispatcher references

Drain

Logging drain

DynamicPortAccess

A mechanism for dynamically getting references to provided/required ports from a component.

From

Used to do value-to-value conversions while consuming the input value. It is the reciprocal of Into.

Fulfillable

Anything that can be fulfilled with a value of type T.

FutureCollection

Convenience methods for collections containing futures

FutureResultCollection

Convenience methods for collections containing future results

Into

A value-to-value conversion that consumes the input value. The opposite of From.

IterExtras

Additional iterator functions

MessageBounds

Just a trait alias hack to avoid connstantly writing Debug+Send+'static

NetworkActor

A trait for actors that handle the same set of messages locally and remotely

Port

A Kompact port specifies the API of an abstraction

Receiver

A factory trait for recipients

Request

A marker trait for messags that expect a response

SerIdBuf

A trait to retrieve a SerId from a buffer.

SerIdBufMut

A trait to put a SerId into a mutable buffer.

SerIdSize

A trait that allows to determine the number of bytes in a SerId.

Serialisable

A trait for values that can serialise themselves into a buffer

SerialisationId

A trait that acts like a stable TypeId for serialisation

Serialiser

A trait for types that can serialise data of type T

SystemField

Methods for things that contain a SystemPath

SystemHandle

A limited version of a KompactSystem

Timer

API exposed within a component by a timer implementation

TimerRefFactory

A factory trait to produce instances of TimerRef

TryClone

A fallable version of the Clone trait

Functions

biconnect_components

Connect two components on their instances of port type P.

biconnect_ports

Connect two port instances.

block_on

Run a future to completion on the current thread.

block_until

Blocks the current waiting for f to be completed or for the timeout to expire

on_dual_definition

Applies function f to the component definitions of c1 and c2, while holding both mutexes.

promise

Produces a new KPromise/KFuture pair.

Type Definitions

DispatcherRef

The type of actor references for dispatcher implementations

RegistrationResult

Convenience alias for the result of a path registration attempt

SerId

Type alias for the concrete implementation of serialisation ids.

Derive Macros

Actor

A macro to derive empty actor implementations

ComponentDefinition

A macro to derive fair ComponentDefinition implementations