pub enum Message {
Show 16 variants
Flow,
Event(EncodableValue),
Boolean(bool),
Integer(i64),
Float(f64),
String(Arc<String>),
Object(Arc<EncodableValue>),
Array(Arc<Vec<EncodableValue>>),
Bytes(Arc<Vec<u8>>),
StreamHandle(Arc<StreamHandle>),
Encoded(Arc<Vec<u8>>),
Optional(Option<Arc<EncodableValue>>),
Any(Arc<EncodableValue>),
Error(Arc<String>),
RemoteReference {
network_id: String,
actor_id: String,
port: String,
},
NetworkEvent {
event_type: NetworkEventType,
data: EncodableValue,
},
}Variants§
Flow
Control-flow signal carrying no data. Used to trigger execution or propagate completion through the graph.
Event(EncodableValue)
Arbitrary event payload. Carries a dynamically-typed value typically originating from external triggers or user interactions.
Boolean(bool)
Boolean value.
Integer(i64)
Signed 64-bit integer value.
Float(f64)
64-bit floating-point value.
String(Arc<String>)
UTF-8 text data (ref-counted for cheap cloning through connectors).
Object(Arc<EncodableValue>)
Structured key-value object (JSON-like). Schema is dynamic;
use PortType::Object(name) at the port level for type hints.
Array(Arc<Vec<EncodableValue>>)
Ordered list of dynamically-typed elements.
Bytes(Arc<Vec<u8>>)
Raw binary data blob. For static binary payloads (images, encoded
buffers, etc.) that fit in memory. Not a live stream — see
StreamHandle for async streaming between actors.
StreamHandle(Arc<StreamHandle>)
Handle to a live data stream managed by the [StreamRegistry].
The actual data flows through a bounded side-channel; this variant
carries only the serializable metadata needed to locate the channel.
Consumers call ActorContext::take_stream_receiver() to obtain the
flume::Receiver<StreamFrame> for async iteration.
Encoded(Arc<Vec<u8>>)
Pre-encoded binary payload (bitcode/zstd compressed). Used for efficient serialization across network boundaries or persistence.
Optional(Option<Arc<EncodableValue>>)
Nullable wrapper around any value. None represents an absent
or skipped input on an optional port.
Any(Arc<EncodableValue>)
Escape hatch for values that don’t fit other variants. Accepts
any EncodableValue and matches PortType::Any.
Error(Arc<String>)
Error message propagated through the graph. Actors can pattern-match on this to implement error-handling branches.
RemoteReference
Proxy reference to an actor port on a remote network. Used by distributed graph composition to route messages across boundaries.
NetworkEvent
Internal network lifecycle event (actor registered, heartbeat missed, etc.). Consumed by system-level actors, not user graphs.
Implementations§
Source§impl Message
impl Message
pub fn decode_with_config( bytes: &[u8], config: CompressionConfig, ) -> Result<Message, MessageError>
Sourcepub fn validate_type(&self, port_type: &PortType) -> Result<(), MessageError>
pub fn validate_type(&self, port_type: &PortType) -> Result<(), MessageError>
Validate message against a port type
Sourcepub fn encoded_size(&self) -> Result<usize, MessageError>
pub fn encoded_size(&self) -> Result<usize, MessageError>
Get encoded size
Sourcepub fn encode_with_config(
&self,
config: &CompressionConfig,
) -> Result<EncodedMessage, MessageError>
pub fn encode_with_config( &self, config: &CompressionConfig, ) -> Result<EncodedMessage, MessageError>
Encode message with configurable compression
Sourcepub fn compress_data(
&self,
data: &[u8],
config: &CompressionConfig,
) -> Result<Vec<u8>, MessageError>
pub fn compress_data( &self, data: &[u8], config: &CompressionConfig, ) -> Result<Vec<u8>, MessageError>
Compress data with configured compression level
Sourcepub fn compress_streaming(
&self,
data: &[u8],
config: &CompressionConfig,
) -> Result<Vec<u8>, MessageError>
pub fn compress_streaming( &self, data: &[u8], config: &CompressionConfig, ) -> Result<Vec<u8>, MessageError>
Streaming compression for large data
Sourcepub fn decode_compressed(
bytes: &[u8],
config: &CompressionConfig,
) -> Result<Message, MessageError>
pub fn decode_compressed( bytes: &[u8], config: &CompressionConfig, ) -> Result<Message, MessageError>
Decode message with automatic decompression
Source§impl Message
impl Message
pub fn object(value: EncodableValue) -> Message
pub fn any(value: EncodableValue) -> Message
pub fn event(value: EncodableValue) -> Message
pub fn array(messages: Vec<EncodableValue>) -> Message
pub fn bytes(bytes: Vec<u8>) -> Message
pub fn stream_handle(handle: StreamHandle) -> Message
pub fn encoded(encoded: Vec<u8>) -> Message
pub fn error(msg: String) -> Message
pub fn boolean(value: bool) -> Message
pub fn integer(value: i64) -> Message
pub fn float(value: f64) -> Message
pub fn string(value: String) -> Message
pub fn flow() -> Message
pub fn optional(msg: Option<EncodableValue>) -> Message
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Message, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Message, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Message
impl Serialize for Message
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl<'__de> Decode<'__de> for Message
impl Encode for Message
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin for Message
impl UnwindSafe for Message
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.